Skip to content

Zip file with backslash as path separator causes issues #96

@WEGFan

Description

@WEGFan

If there's a zip file using \ in game's Mods folder, Loenn will have an issue loading it. After loading all files and enter the editor scene, the toolbars won't show up, and Loenn will crash with a bluescreen if you try to click something.

Image
[INFO] Registered scene 'Editor'
[INFO] Registered scene 'Loading'
[INFO] Registered scene 'Startup'
[INFO] Initialized runtime atlases with up to 8 layers
[INFO] Added another runtime atlas number 1
[INFO] Loaded image 'E:\Steam\steamapps\common\Celeste\Content\Graphics\Atlases\Gameplay0.data' to atlas layer 1 at (0, 0) with size 4096x4096
[INFO] Added another runtime atlas number 2
[INFO] Loaded image 'E:\Steam\steamapps\common\Celeste\Content\Graphics\Atlases\Gui0.data' to atlas layer 2 at (0, 0) with size 4096x4096
[INFO] Updated filename cache for 'BackslashTest_zip'
[WARNING] Task Failed: stack overflow
[WARNING] stack traceback:
	[C]: in function 'getDirectoryItems'
	[string "utils/filesystem.lua"]:227: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	...
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:251: in function 'findRecursive'
	[string "utils/filesystem.lua"]:265: in function 'getFilenames'
	[string "mods.lua"]:531: in function 'getOrCacheFilenames'
	[string "mods.lua"]:54: in function 'findModFolderFiletype'
	[string "mods.lua"]:87: in function 'findPlugins'
	[string "scene_handler.lua"]:174: in function 'loadExternalScenes'
	[string "scenes/loading.lua"]:74: in function 'func'
	[string "utils/tasks.lua"]:203: in function <[string "utils/tasks.lua"]:203>
[ERROR] Editor version: 1.0.5
Love2d version: 11.5.0 - Mysterious Mysteries
Operating system: Windows

[string "input_devices/tool_device.lua"]:34: attempt to index local 'currentTool' (a nil value)
stack traceback:
	[string "selene_main.lua"]:65: in function 'handler'
	[love "boot.lua"]:352: in function '__index'
	[string "input_devices/tool_device.lua"]:34: in function 'tryRoomSwap'
	[string "input_devices/tool_device.lua"]:83: in function <[string "input_devices/tool_device.lua"]:80>
	[string "input_device.lua"]:28: in function <[string "input_device.lua"]:15>
	[string "scene_handler.lua"]:46: in function 'sendEvent'
	[string "input_handler.lua"]:80: in function <[string "input_handler.lua"]:68>
	[string "main.lua"]:36: in function <[string "main.lua"]:25>
	[C]: in function 'xpcall'
	[love "boot.lua"]:377: in function <[love "boot.lua"]:344>

Sample zip file: BackslashTest.zip

Compress-Archive command in Windows PowerShell 5.1 can be used to create a zip file with \ as path separator, but PowerShell 7+ fixes this issue and used / instead.

Using Windows PowerShell 5.1:

C:\Users\wegfan\test>powershell
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。

尝试新的跨平台 PowerShell https://aka.ms/pscore6

PS C:\Users\wegfan\test> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      22621  5624

PS C:\Users\wegfan\test> Compress-Archive -Path * -DestinationPath 1.zip
PS C:\Users\wegfan\test> unzip -l 1.zip
Archive:  1.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2025-09-01 09:34   a\b.txt
       39  2025-09-01 09:35   everest.yaml
---------                     -------
       39                     2 files

Using PowerShell 7+:

C:\Users\wegfan\test>pwsh
PowerShell 7.5.0

   A new PowerShell stable release is available: v7.5.2
   Upgrade now, or check out the release page at:
     https://aka.ms/PowerShell-Release?tag=v7.5.2

PS C:\Users\wegfan\test> Compress-Archive -Path * -DestinationPath 2.zip
PS C:\Users\wegfan\test> unzip -l 2.zip
Archive:  2.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2025-09-01 09:34   a/b.txt
       39  2025-09-01 09:35   everest.yaml
---------                     -------
       39                     2 files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions