Menu

#188 Mishandling of environment variables whose value starts with a '/'

1.0
closed
nobody
None
2017-02-04
2015-08-17
No

I'm seeing an issue where if you launch a Msys shell and export an environment variable that starts with a forward slash, a child Win32 process that requests the environment variable will get an unexpected result.

Steps to reproduce:

Launch a MSYS2 shell: Start>MSYS2 64bit>MSYS2 Shell
export my_var=/foo
echo $my_var

/foo
cmd
echo %my_var%
c:/msys64/foo

Discussion

  • Ray Donnelly

    Ray Donnelly - 2015-08-17

    MSYS2 converts things (arguments to processes and environment variables) that look like POSIX paths to their Windows equivalent, that's one of the key MSYS? features that allows interoperation between msys2 programs and Windows programs. We have a way of selectively disabling it for arguments to processes but not for environment variables (you can read about it here: https://sourceforge.net/p/msys2/wiki/Porting/). If you want this changed please add a bug to https://github.com/Alexpux/MSYS2-packages/issues

     
  • David Macek

    David Macek - 2017-02-04
    • status: open --> closed
     
  • David Macek

    David Macek - 2017-02-04

    Closing because the discussion moved to GitHub.