You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@locus.apache.org on 2000/03/03 07:06:59 UTC

cvs commit: apache-2.0/src/lib/apr/threadproc/win32 proc.c threadproc.h

stoddard    00/03/02 22:06:59

  Modified:    src/lib/apr/threadproc/win32 proc.c threadproc.h
  Log:
  Win32: Use the COMSPEC envar to set the shell name.
  
  Submitted by: Bill Rowe <wr...@Ind.com>
  Reviewed by: Bill Stoddard <st...@apache.org>
  
  Revision  Changes    Path
  1.17      +6 -20     apache-2.0/src/lib/apr/threadproc/win32/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/win32/proc.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- proc.c	2000/01/28 04:21:59	1.16
  +++ proc.c	2000/03/03 06:06:58	1.17
  @@ -228,7 +228,7 @@
       }
   
       if (attr->cmdtype == APR_PROGRAM) {
  -        char *ptr = progname;
  +        const char *ptr = progname;
   
           if (*ptr =='"') {
               ptr++;
  @@ -251,25 +251,11 @@
           }
       }
       else {
  -        char * shell_cmd;
  -        OSVERSIONINFO osver;
  -        osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  -
  -        /*
  -         * Use CMD.EXE for NT, COMMAND.COM for WIN95
  -         */
  -        if (GetVersionEx(&osver)) {
  -            if (osver.dwPlatformId != VER_PLATFORM_WIN32_NT) {
  -            shell_cmd = ap_pstrdup(cont, "COMMAND.COM /C ");
  -         }
  -         else {
  -            shell_cmd = ap_pstrdup(cont, "CMD.EXE /C ");
  -          }
  -       }
  -       else {
  -          shell_cmd = ap_pstrdup(cont, "CMD.EXE /C ");
  -       }
  -       cmdline = ap_pstrcat(cont, shell_cmd, progname, NULL);
  +        char * shell_cmd = getenv("COMSPEC");
  +        if (!shell_cmd)
  +            shell_cmd = SHELL_PATH;
  +        shell_cmd = ap_pstrdup(cont, shell_cmd);
  +        cmdline = ap_pstrcat(cont, shell_cmd, " /C ", progname, NULL);
       }
   
       i = 1;
  
  
  
  1.3       +1 -1      apache-2.0/src/lib/apr/threadproc/win32/threadproc.h
  
  Index: threadproc.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/win32/threadproc.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- threadproc.h	2000/01/28 02:08:20	1.2
  +++ threadproc.h	2000/03/03 06:06:58	1.3
  @@ -60,7 +60,7 @@
   #ifndef THREAD_PROC_H
   #define THREAD_PROC_H
   
  -#define SHELL_PATH "/bin/sh"
  +#define SHELL_PATH "cmd.exe"
   
   struct thread_t {
       ap_context_t *cntxt;