]> ruderich.org/simon Gitweb - fcscs/fcscs.git/commitdiff
run_command(): encode arguments inside run_command()
authorSimon Ruderich <simon@ruderich.org>
Wed, 27 Jan 2016 16:25:05 +0000 (17:25 +0100)
committerSimon Ruderich <simon@ruderich.org>
Wed, 27 Jan 2016 16:25:37 +0000 (17:25 +0100)
bin/fcscs

index 230d4bc9440b1900f21ece73fd01330fb0d29c8d..66c8410bc7a24a372568063c078b7b57dff8f3b7 100755 (executable)
--- 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;