diff --git a/basis/io/launcher/windows/windows-tests.factor b/basis/io/launcher/windows/windows-tests.factor index d040edb302..3d3d29a937 100644 --- a/basis/io/launcher/windows/windows-tests.factor +++ b/basis/io/launcher/windows/windows-tests.factor @@ -13,6 +13,12 @@ IN: io.launcher.windows.tests [ "bob \"mac arthur\\\\\"" ] [ { "bob" "mac arthur\\" } join-arguments ] unit-test +! Bug #245 +[ "\\\"hi\\\"" ] [ { "\"hi\"" } join-arguments ] unit-test + +[ "\"\\\"hi you\\\"\"" ] [ { "\"hi you\"" } join-arguments ] unit-test + + [ ] [ "notepad" >>command diff --git a/basis/io/launcher/windows/windows.factor b/basis/io/launcher/windows/windows.factor index 47aeb0c712..100f2d36ff 100755 --- a/basis/io/launcher/windows/windows.factor +++ b/basis/io/launcher/windows/windows.factor @@ -58,7 +58,11 @@ TUPLE: CreateProcess-args 0 count-trailing-backslashes 2 * CHAR: \\ append ; +: escape-double-quote ( str -- newstr ) + "\"" split "\\\"" join ; + : escape-argument ( str -- newstr ) + escape-double-quote CHAR: \s over member? [ fix-trailing-backslashes "\"" dup surround ] when ;