mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Perform better fixups of NT paths in execve()
This change ensures we do a better job translating /c/foo.bar paths into c:/foo.bar paths on Windows when generating the CreateProcess() cmd line thus fixing a regression that happened in the last two months when using the help() feature of Actually Portable Python in the CMD.EXE shell.
This commit is contained in:
parent
cfb5d3e406
commit
701564de19
4 changed files with 50 additions and 10 deletions
|
@ -78,16 +78,29 @@ TEST(mkntcmdline, testUnicode) {
|
|||
cmdline);
|
||||
}
|
||||
|
||||
TEST(mkntcmdline, fix) {
|
||||
TEST(mkntcmdline, fixAsBestAsWeCanForNow1) {
|
||||
char *argv1[] = {
|
||||
"C:/WINDOWS/system32/cmd.exe",
|
||||
"/C/WINDOWS/system32/cmd.exe",
|
||||
"/C",
|
||||
"more < \"C:\\Users\\jart\\AppData\\Local\\Temp\\tmplquaa_d6\"",
|
||||
"more < \"/C/Users/jart/AppData/Local/Temp/tmplquaa_d6\"",
|
||||
NULL,
|
||||
};
|
||||
EXPECT_NE(-1, mkntcmdline(cmdline, argv1[0], argv1));
|
||||
EXPECT_STREQ(u"C:\\WINDOWS\\system32\\cmd.exe /C \"more < "
|
||||
u"\\\"C:\\Users\\jart\\AppData\\Local\\Temp\\tmplquaa_d6\\\"\"",
|
||||
u"\\\"C:/Users/jart/AppData/Local/Temp/tmplquaa_d6\\\"\"",
|
||||
cmdline);
|
||||
}
|
||||
|
||||
TEST(mkntcmdline, fixAsBestAsWeCanForNow2) {
|
||||
char *argv1[] = {
|
||||
"/C/WINDOWS/system32/cmd.exe",
|
||||
"/C",
|
||||
"less /C/Users/jart/AppData/Local/Temp/tmplquaa_d6",
|
||||
NULL,
|
||||
};
|
||||
EXPECT_NE(-1, mkntcmdline(cmdline, argv1[0], argv1));
|
||||
EXPECT_STREQ(u"C:\\WINDOWS\\system32\\cmd.exe /C \"less "
|
||||
u"C:/Users/jart/AppData/Local/Temp/tmplquaa_d6\"",
|
||||
cmdline);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue