mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 11:48:30 +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
|
@ -72,12 +72,14 @@ static textwindows void FixPath(char *path) {
|
|||
|
||||
// turn \c\... into c:\...
|
||||
p = path;
|
||||
if (p[0] == '/' && IsAlpha(p[1]) && p[2] == '/') {
|
||||
if ((p[0] == '/' | p[0] == '\\') && IsAlpha(p[1]) &&
|
||||
(p[2] == '/' || p[2] == '\\')) {
|
||||
p[0] = p[1];
|
||||
p[1] = ':';
|
||||
}
|
||||
for (; *p; ++p) {
|
||||
if (p[0] == ';' && p[1] == '/' && IsAlpha(p[2]) && p[3] == '/') {
|
||||
if (p[0] == ';' && (p[1] == '/' || p[1] == '\\') && IsAlpha(p[2]) &&
|
||||
(p[3] == '/' || p[3] == '\\')) {
|
||||
p[1] = p[2];
|
||||
p[2] = ':';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue