https://bugs.winehq.org/show_bug.cgi?id=48491
Bug ID: 48491 Summary: _searchenv & co do not understand quoted directories Product: Wine Version: 5.0-rc4 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: wine@thecybershadow.net Distribution: ---
The following test program produces the expected result ("testdir\testfile") on Windows, but fails on Wine:
#include <io.h> #include <direct.h> #include <stdlib.h> #include <sys/stat.h> #include <stdio.h>
int main(void) { char buf[64];
_mkdir("testdir"); _close(_creat("testdir\testfile", _S_IREAD | _S_IWRITE));
_putenv("TESTVAR="testdir""); _searchenv("testfile", "TESTVAR", buf); printf("Result: %s\n", buf); }
The cause seems to be that Wine doesn't seem to implement the quoting syntax in the searchenv function family.
The problem was noticed when MS link.exe invocation failed on Wine but not Windows, with identical environment / inputs. Such environment variables can occur when building search paths for linker libraries (%LIB%), as seen here:
https://github.com/dlang/dmd/blob/81710a5e548f047588bd3ee6ffb13a8d6f1b9bff/i...