From 2ec76c78c7b0d634e7cc83e4e0f7711c9cacdaf5 Mon Sep 17 00:00:00 2001 From: Christian Walde Date: Tue, 18 Dec 2018 23:34:54 +0100 Subject: [PATCH] Quote mysql.exe calls on Windows correctly because IPC::S::S doesn't. run() here calls IPC::S::S' runx(), which has two paths. On non-windows systems it calls `system { $command } $command, @args` which works just fine even with complex stuff in the args. On Windows however it calls `_spawn_or_die($command, "$command @args")`, which smashes all the arguments together separated by spaces without *any* additional quoting. This results in a garbage process call which mysql consequently rewards with RTFM. This fix quotes the arguments on windows, and takes care to leave the executable name separate to allow proper naming of the created process object. fixes #262 --- lib/App/Sqitch.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/App/Sqitch.pm b/lib/App/Sqitch.pm index 4b30df855..5f9002516 100644 --- a/lib/App/Sqitch.pm +++ b/lib/App/Sqitch.pm @@ -358,7 +358,7 @@ sub run { ( my $msg = shift ) =~ s/\s+at\s+.+/\n/ms; die $msg; }; - runx @_; + runx $^O eq 'MSWin32' ? ( shift, $self->quote_shell(@_) ) : @_; return $self; }