fix handling of empty paths in PATH on Windows

Check for an empty path after dropping `"`s, instead of before.
Otherwise, a bad PATH setting interferes with functions like
`find-executable-path`, which in turn can prevent DrRacket from
starting up.

Closes PR 14930
This commit is contained in:
Matthew Flatt 2015-01-13 06:48:40 -07:00
parent 719917f812
commit 33da6564a1
3 changed files with 740 additions and 739 deletions

File diff suppressed because it is too large Load Diff

View File

@ -293,12 +293,13 @@
" \":\")))"
" (format \"([^~a]*)~a(.*)\" sep sep)))))"
"(cons-path(lambda(default s l) "
"(let((s(if(eq?(system-type) 'windows)"
" (regexp-replace* #rx#\"\\\"\" s #\"\")"
" s)))"
" (if (bytes=? s #\"\")"
"(append default l)"
"(cons(bytes->path(if(eq?(system-type) 'windows)"
" (regexp-replace* #rx#\"\\\"\" s #\"\")"
" s))"
" l)))))"
"(cons(bytes->path s)"
" l))))))"
"(lambda(s default)"
"(unless(or(bytes? s)"
"(string? s))"

View File

@ -349,12 +349,13 @@
":")))
(format "([^~a]*)~a(.*)" sep sep)))))
(cons-path (lambda (default s l)
(let ([s (if (eq? (system-type) 'windows)
(regexp-replace* #rx#"\"" s #"")
s)])
(if (bytes=? s #"")
(append default l)
(cons (bytes->path (if (eq? (system-type) 'windows)
(regexp-replace* #rx#"\"" s #"")
s))
l)))))
(cons (bytes->path s)
l))))))
(lambda (s default)
(unless (or (bytes? s)
(string? s))