From: Simon Ruderich Date: Wed, 27 Jan 2016 16:25:05 +0000 (+0100) Subject: run_command(): encode arguments inside run_command() X-Git-Url: https://ruderich.org/simon/gitweb/?p=fcscs%2Ffcscs.git;a=commitdiff_plain;h=693b2782b3c8b103bb81ad0d7df169859a5f453d;ds=sidebyside run_command(): encode arguments inside run_command() --- diff --git a/bin/fcscs b/bin/fcscs index 230d4bc..66c8410 100755 --- a/bin/fcscs +++ b/bin/fcscs @@ -459,7 +459,8 @@ sub run_command { # a working $$. no warnings; - system { $cmd->[0] } @{$cmd}; + my @cmd = map { $screen->encode($_) } @{$cmd}; + system { $cmd[0] } @cmd; }; if ($exit != 0) { my $msg; @@ -898,10 +899,7 @@ sub handler_url { $screen->debug('handler_url', "opening $match->{value}"); run_in_background($screen, sub { - my @cmd = map { $screen->encode($_) } ( - @{$config->{setting}{browser}}, - $match->{value}, - ); + my @cmd = ( @{$config->{setting}{browser}}, $match->{value} ); run_command($screen, $config, \@cmd); }); return;