Add raw_execvp, to use with already converted strings
authorNelson Ferreira <nelson.ferreira@ieee.org>
Sat, 14 Mar 2020 23:29:24 +0000 (19:29 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Sat, 14 Mar 2020 23:29:24 +0000 (19:29 -0400)
src/sysdep.c
src/sysfile.h

index 0828973..b2980fd 100644 (file)
@@ -2772,7 +2772,8 @@ int sys_execvp(const char *path, char *const *argv)
 
        PATHNAME_CONVERT_OUT(path, pout);
        for (argc = 0; argv[argc]; argc++);
-       {
+
+       do {
                /* c99ified */
                char *new_argv[argc+1];
                for (i = 0; i < argc; i++) {
@@ -2780,9 +2781,15 @@ int sys_execvp(const char *path, char *const *argv)
                }
                new_argv[argc] = NULL;
                return execvp(pout, new_argv);
-       }
+       } while (0);
 }
 #endif                         /* ENCAPSULATE_EXECVP */
+
+int raw_execvp(const char *path, char *const *argv)
+{
+        return execvp(path, argv);
+}
+
 \f
 /************************************************************************/
 /*                  Emulations of missing system calls                  */
index df59f91..9229d0a 100644 (file)
@@ -510,6 +510,8 @@ int sys_execvp(const char *, char *const *);
 # define sys_execvp execvp
 #endif
 
+int raw_execvp(const char *, char *const *);
+
 /* How long can a source filename be in DOC (including "\037S" at the start
     and "\n" at the end) ? */
 #define DOC_MAX_FILENAME_LENGTH 2048