httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src CHANGES
Date Thu, 18 May 2000 14:11:42 GMT
trawick     00/05/18 07:11:40

  Modified:    src/main util.c
               src      CHANGES
  Log:
  The following is a patch to fix Dirk's patch from March 14 so that
  mod_rewrite will work without caveats. Basically Dirk was just
  dropping patterns of the form ${x} if x didn't resolve to an
  environment variable. That breaks mod_rewrite since mod_rewrite
  uses the same syntax for some of its non-environment directives.
  
  The patch below simply puts the behavior for unresolved values back
  to what it was before Dirk's patch. If it is unresolved, it is just
  left in the directive as is. Further processing will handle the value.
  
  Dirk's optimization still holds if x is resolved. A small price is paid
  if x is not resolved, but that shouldn't happen often.
  
  (Note: some tweaks to the comments were negotiated offline after Paul
  posted the patch to new-httpd.)
  Submitted by:	Paul Reder <rederpj@raleigh.ibm.com>
  Reviewed by:	Jeff Trawick
  
  Revision  Changes    Path
  1.45      +8 -4      apache-2.0/src/main/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/util.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- util.c	2000/05/17 01:52:48	1.44
  +++ util.c	2000/05/18 14:11:23	1.45
  @@ -766,9 +766,8 @@
   /* Check a string for any ${ENV} environment variable
    * construct and replace each them by the value of
    * that environment variable, if it exists. If the
  - * environment value does not exist, replace by an
  - * empty string. Any unrecognized construct is not
  - * replaced and silently ignored.
  + * environment value does not exist, leave the ${ENV}
  + * construct alone; it means something else.
    */
   API_EXPORT(char *) ap_resolve_env(ap_pool_t *p, const char * word)
   {
  @@ -787,7 +786,12 @@
                          *e = '\0';
                          word = e + 1;
                          e = getenv(s+2);
  -                       strcat(tmp,e ? e : "");
  +                       if (e) {
  +                           strcat(tmp,e);
  +                       } else {
  +                           strcat(tmp,s);
  +                           strcat(tmp,"}");
  +                       }
                  } else {
                          /* ignore invalid strings */
                          word = s+1;
  
  
  
  1.114     +5 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.113
  retrieving revision 1.114
  diff -u -r1.113 -r1.114
  --- CHANGES	2000/05/17 03:19:40	1.113
  +++ CHANGES	2000/05/18 14:11:35	1.114
  @@ -1,4 +1,9 @@
   Changes with Apache 2.0a4
  +  *) Fix ap_resolve_env() so that it handles new function added in a prior
  +     alpha (see "Added the capability to do ${ENVVAR} constructs in the
  +     config file.") as well as the constructs used by mod_rewrite.
  +     [Paul Reder <rederpj@raleigh.ibm.com>]
  +
     *) Apache 2.0 builds and runs on OS/390. [Jeff Trawick, Greg Ames]
   
     *) Change the EBCDIC support in functions for MD5, SHA1, and base 64 to use
  
  
  

Mime
View raw message