httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@hyperreal.org
Subject cvs commit: apache-1.3/src/ap ap_execve.c
Date Fri, 27 Feb 1998 09:46:33 GMT
martin      98/02/27 01:46:33

  Modified:    src/ap   ap_execve.c
  Log:
  Oops! I should never publish a function without actually testing it...
  ap_execle() forgot to pass argv[0] to the program!
  
  Revision  Changes    Path
  1.7       +6 -5      apache-1.3/src/ap/ap_execve.c
  
  Index: ap_execve.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/ap/ap_execve.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- ap_execve.c	1998/02/14 13:51:07	1.6
  +++ ap_execve.c	1998/02/27 09:46:31	1.7
  @@ -108,7 +108,7 @@
    * local argv[] array. The va_arg logic makes sure we do the right thing.
    * XXX: malloc() is used because we expect to be overlaid soon.
    */
  -int ap_execle(const char *filename, const char *arg, ...)
  +int ap_execle(const char *filename, const char *argv0, ...)
   {
       va_list adummy;
       char **envp;
  @@ -116,8 +116,8 @@
       int argc, ret;
   
       /* First pass: Count arguments on stack */
  -    va_start(adummy, arg);
  -    for (argc = 0; va_arg(adummy, char *) != NULL; ++argc) {
  +    va_start(adummy, argv0);
  +    for (argc = 1; va_arg(adummy, char *) != NULL; ++argc) {
   	continue;
       }
       va_end(adummy);
  @@ -125,8 +125,9 @@
       argv = (char **) malloc((argc + 2) * sizeof(*argv));
   
       /* Pass two --- copy the argument strings into the result space */
  -    va_start(adummy, arg);
  -    for (argc = 0; (argv[argc] = va_arg(adummy, char *)) != NULL; ++argc) {
  +    va_start(adummy, argv0);
  +    argv[0] = argv0;
  +    for (argc = 1; (argv[argc] = va_arg(adummy, char *)) != NULL; ++argc) {
   	continue;
       }
       envp = va_arg(adummy, char **);
  
  
  

Mime
View raw message