From 327088eb578a0735092b848475594c9f76cc4945 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Tue, 9 Oct 2012 17:12:09 +0100 Subject: [PATCH] Deparse: handle system/exec prog arg,arg,,.. Deparse wasn't handling the form of system and exec where the extra first arg (without comma) gave the program name. These now deparse ok, without an additional comma: system $prog $arg1,$arg2; exec $prog $arg1,$arg2; --- dist/B-Deparse/Deparse.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index 88cce1f..612676b 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -2568,6 +2568,15 @@ sub listop { return "$exprs[0] = $fullname" . ($parens ? "($exprs[0])" : " $exprs[0]"); } + if ($name =~ /^(system|exec)$/ + && ($op->flags & OPf_STACKED) + && @exprs > 1) + { + # handle the "system prog a1,a2,.." form + my $prog = shift @exprs; + $exprs[0] = "$prog $exprs[0]"; + } + if ($parens && $nollafr) { return "($fullname " . join(", ", @exprs) . ")"; } elsif ($parens) { -- 2.7.4