Menu

#83 bad use of %~dp0

2.0
closed
Alexx83
None
2014-10-12
2014-09-25
No

Just a heads up.

the %~dp0 variable must newer be followed by a slash or backslash i noticed several places
where it was put up as WD=%~dp0\usr\bin\ it should be WD=%~dp0usr\bin\ or you will get
a trailing slash in the path. This can essentially break things because a \ gets converted to a / in windows.

example from printenv WD=H:\msys2\usr\bin\ notice the \ this means the variable is now read as WD=H:\msys2/usr\bin. Windows support for reading a / in path is shoddy at best
so its better to avoid it. if you just want to get current dir from windows its better
to use %CD% which does not have this problem.

Discussion

  • ralph engels

    ralph engels - 2014-09-28

    the \ is a double \ githubs formatting kills the second .

     
  • Alexx83

    Alexx83 - 2014-10-12

    Thanks! Fixed in filesystem-2014.10-1 package.

     
  • Alexx83

    Alexx83 - 2014-10-12
    • status: open --> closed
    • assigned_to: Alexx83