Skip to content

Commit

Permalink
Merge pull request #4138 from patrickbkr/fix-win-proc-with-space
Browse files Browse the repository at this point in the history
Fix calling programs with spaces in their path on Windows
  • Loading branch information
patrickbkr committed Dec 30, 2020
2 parents 63be83d + b3367e9 commit 86fd7f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/core.c/Proc/Async.pm6
Expand Up @@ -326,17 +326,19 @@ my class Proc::Async {
# So it's not easily possible to do the quoting ourselves.
# So the $!win-quote-args argument is ignored on JVM and we
# just let Java do its magic.
my @quoted-args := @!args;
my @quoted-args := $!path, |@!args;
#?endif
#?if !jvm
my @quoted-args;
if Rakudo::Internals.IS-WIN {
@quoted-args.append($!win-verbatim-args
?? @!args.join(' ')
!! self!win-quote-CommandLineToArgvW(@!args));
@quoted-args.append(
self!win-quote-CommandLineToArgvW($!path),
$!win-verbatim-args
?? @!args.join(' ')
!! self!win-quote-CommandLineToArgvW(@!args));
}
else {
@quoted-args := @!args;
@quoted-args := $!path, |@!args;
}
#?endif
Expand Down Expand Up @@ -393,7 +395,7 @@ my class Proc::Async {
nqp::bindkey($callbacks, 'stderr_fd', $!stderr-fd) if $!stderr-fd.DEFINITE;
$!process_handle := nqp::spawnprocasync($scheduler.queue(:hint-affinity),
CLONE-LIST-DECONTAINERIZED($!path,@quoted-args),
CLONE-LIST-DECONTAINERIZED($!path, @quoted-args),
$cwd.Str,
CLONE-HASH-DECONTAINERIZED(%ENV),
$callbacks,
Expand Down
2 changes: 1 addition & 1 deletion tools/templates/NQP_REVISION
@@ -1 +1 @@
2020.12-1-gde93c668c
2020.12-4-gd65a8c109

0 comments on commit 86fd7f6

Please sign in to comment.