[Bug 48491] New: _searchenv & co do not understand quoted directories

WineHQ Bugzilla wine-bugs at winehq.org
Tue Jan 21 13:12:59 CST 2020


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 at winehq.org
          Reporter: wine at 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/ini/windows/bin/sc.ini#L73-L91

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list