[perl #131730] Fix exec PROGRAM LIST with empty LIST on VMS
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Fri, 1 Sep 2017 11:11:53 +0000 (12:11 +0100)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Wed, 18 Oct 2017 10:44:17 +0000 (11:44 +0100)
Only when being Unixish, because I have no idea if
setup_argstr()/vms_do_exec() handle it.

vms/vms.c

index 5ca4d7c..df0aed8 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -10953,16 +10953,16 @@ Perl_vms_do_aexec(pTHX_ SV *really,SV **mark,SV **sp)
   bool exec_sts;
   char * cmd;
 
-  if (sp > mark) {
-    if (vfork_called) {           /* this follows a vfork - act Unixish */
-      vfork_called--;
-      if (vfork_called < 0) {
-        Perl_warn(aTHX_ "Internal inconsistency in tracking vforks");
-        vfork_called = 0;
-      }
-      else return do_aexec(really,mark,sp);
+  if (vfork_called) {           /* this follows a vfork - act Unixish */
+    vfork_called--;
+    if (vfork_called < 0) {
+      Perl_warn(aTHX_ "Internal inconsistency in tracking vforks");
+      vfork_called = 0;
     }
+    else return do_aexec(really,mark,sp);
+  }
                                            /* no vfork - act VMSish */
+  if (sp > mark) {
     cmd = setup_argstr(aTHX_ really,mark,sp);
     exec_sts = vms_do_exec(cmd);
     Safefree(cmd);  /* Clean up from setup_argstr() */