httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/arch/win32 mod_win32.c
Date Sun, 23 Jun 2002 09:52:55 GMT
wrowe       2002/06/23 02:52:55

  Modified:    modules/arch/win32 mod_win32.c
  Log:
    The fix wasn't healthy for Win9x.  Work around pre-Unicode flavors.
  
  Revision  Changes    Path
  1.19      +20 -3     httpd-2.0/modules/arch/win32/mod_win32.c
  
  Index: mod_win32.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/arch/win32/mod_win32.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mod_win32.c	23 Jun 2002 07:56:41 -0000	1.18
  +++ mod_win32.c	23 Jun 2002 09:52:55 -0000	1.19
  @@ -74,6 +74,9 @@
   
   #ifdef WIN32
   
  +extern OSVERSIONINFO osver; /* hiding in mpm_winnt.c */
  +static int win_nt;
  +
   /* 
    * CGI Script stuff for Win32...
    */
  @@ -141,12 +144,15 @@
    * will read characters 80-ff.  For the moment, use the unicode
    * values 0080-00ff.  This isn't trivial, since the code page
    * varies between msdos and Windows applications.
  + * For subsystem 2 [GUI] the default is the system Ansi CP.
  + * For subsystem 3 [CLI] the default is the system OEM CP.
    */ 
   static void prep_string(const char ** str, apr_pool_t *p)
   {
       const char *ch = *str;
       char *ch2;
       int widen = 0;
  +
       if (!ch) {
           return;
       }
  @@ -345,7 +351,9 @@
                       break;
                   }
                   ap_unescape_url(w);
  -                prep_string(&w, p);
  +                if (win_nt) {
  +                   prep_string(&w, p);
  +                }
                   arg = (const char**)apr_array_push(args);
                   *arg = ap_escape_shell_cmd(p, w);
               }
  @@ -438,7 +446,9 @@
                   break;
               }
               ap_unescape_url(w);
  -            prep_string(&w, p);
  +            if (win_nt) {
  +                prep_string(&w, p);
  +            }
               arg = (const char**)apr_array_push(args);
               *arg = ap_escape_shell_cmd(p, w);
           }
  @@ -584,7 +594,7 @@
        * application (following the OEM or Ansi code page in effect.)
        */
       for (i = 0; i < r->subprocess_env->a.nelts; ++i) {
  -        if (elts[i].key && *elts[i].key 
  +        if (win_nt && elts[i].key && *elts[i].key 
                   && (strncmp(elts[i].key, "HTTP_", 5) == 0
                    || strncmp(elts[i].key, "SERVER_", 7) == 0
                    || strncmp(elts[i].key, "REQUEST_", 8) == 0
  @@ -595,9 +605,16 @@
       return APR_SUCCESS;
   }
   
  +static int win32_pre_config(apr_pool_t *pconf_, apr_pool_t *plog, apr_pool_t *ptemp) 
  +{
  +    win_nt = (osver.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS);
  +    return OK;
  +}
  +
   static void register_hooks(apr_pool_t *p)
   {
       APR_REGISTER_OPTIONAL_FN(ap_cgi_build_command);
  +    ap_hook_pre_config(win32_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
   }
   
   static const command_rec win32_cmds[] = {
  
  
  

Mime
View raw message