Correct a bug with #g in list context.
authorShlomi Fish <shlomif@shlomifish.org>
Wed, 10 Oct 2012 18:51:51 +0000 (20:51 +0200)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 Nov 2012 14:18:39 +0000 (09:18 -0500)
It does not work properly there - one should use $1 / etc.

lib/perl5db.pl

index dc3b82d..cd3cd26 100644 (file)
@@ -3899,13 +3899,13 @@ sub _handle_sh_command {
             DB::system( $ENV{SHELL} || "/bin/sh" );
             next CMD;
         }
-        elsif (my ($arg) = $my_cmd =~ m#\G$sh\s*(.*)#cgms) {
+        elsif ($my_cmd =~ m#\G$sh\s*(.*)#cgms) {
             # System it.
-            DB::system($arg);
+            DB::system($1);
             next CMD;
         }
-        elsif (($arg) = $my_cmd =~ m#\G\s*(.*)#cgms) {
-            DB::system( $ENV{SHELL} || "/bin/sh", "-c", $arg );
+        elsif ($my_cmd =~ m#\G\s*(.*)#cgms) {
+            DB::system( $ENV{SHELL} || "/bin/sh", "-c", $1 );
             next CMD;
         }
     }