httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@decus.org (Rodent of Unusual Size)
Subject [PATCH] (corrected) Fix for PR#76 (setlocale and SSI)
Date Wed, 12 Feb 1997 15:43:05 GMT
    Okey, below is a new patch for this; ignore the previous one.  This
    one makes the environment locale setting only apply to SSI
    processing, leaving logging and the like functioning with the
    default (almost certainly the C locale).

    The issue of propagating the environmental locale down through other
    server operations is still something I think needs to be discussed
    for 2.0..

    #ken    :-)}

Index: mod_include.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/mod_include.c,v
retrieving revision 1.21
diff -c -w -r1.21 mod_include.c
*** 1.21	1997/01/20 04:28:13
--- mod_include.c	1997/02/12 15:40:12
***************
*** 66,71 ****
--- 66,72 ----
  #include "http_log.h"
  #include "http_main.h"
  #include "util_script.h"
+ #include <locale.h>
  
  #define STARTING_SEQUENCE "<!--#"
  #define ENDING_SEQUENCE "-->"
***************
*** 1679,1684 ****
--- 1680,1686 ----
      enum xbithack *state =
  	(enum xbithack *)get_module_config(r->per_dir_config,&includes_module);
      int errstatus;
+     char *old_locale;
  
      if (!(allow_options (r) & OPT_INCLUDES)) return DECLINED;
      if (r->method_number != M_GET) return DECLINED;
***************
*** 1706,1711 ****
--- 1708,1715 ----
  	return OK;
      }
     
+     old_locale = pstrdup (r->pool, setlocale (LC_ALL, NULL));
+     setlocale (LC_ALL, "");
      if (r->main) {
  	/* Kludge --- for nested includes, we want to keep the
  	 * subprocess environment of the base document (for compatibility);
***************
*** 1722,1727 ****
--- 1726,1732 ----
      }
      
      send_parsed_content (f, r);
+     setlocale (LC_ALL, old_locale);
      
      kill_timeout (r);
      return OK;

Mime
View raw message