MrcSnm/HipremeEngine

Allow trailing slashes in paths for the script loader

0xEAB opened this issue · 0 comments

0xEAB commented

It would be nice if the script host/loader would allow paths with trailing slashes.

works: bin/desktop/hipreme_engine ./projects/start_here
doesn’t work: bin/desktop/hipreme_engine ./projects/start_here/

core.exception.ArraySliceError@modules/util/source/hip/util/system.d(132): slice [0 .. 3] extends past source array of length 0
----------------
??:? onArraySliceError [0x7ffff78cb16a]
??:? _d_arraybounds_slice [0x7ffff78ca880]
modules/util/source/hip/util/system.d:132 bool hip.util.system.dynamicLibraryIsLibNameValid(immutable(char)[]) [0x55555586882a]
source/hip/systems/hotload.d:37 hip.systems.hotload.HotloadableDLL hip.systems.hotload.HotloadableDLL.__ctor(immutable(char)[], void delegate(void*)) [0x5555556a268e]
source/hip/systems/game.d:145 void hip.systems.game.GameSystem.loadGame(immutable(char)[]) [0x5555556a60cb]
source/app.d:229 void app.gameInitialize() [0x5555556e40a1]
source/app.d:207 [0x5555556e3fa8]
source/hip/global/gamedef.d:84 bool hip.global.gamedef.loadDefaultAssets(void delegate(), void delegate(immutable(char)[])) [0x5555556d763a]
source/app.d:207 HipremeMain [0x5555556e3f89]
source/app.d:348 _Dmain [0x5555556e4238]

Rationale

  • I fail to remember which one the correct one is (trailing slash vs none).
  • Bash completion supplies the path with a trailing slash