You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@hyperreal.org on 1998/08/05 03:36:43 UTC

cvs commit: apache-1.3/src/main util.c

coar        98/08/04 18:36:42

  Modified:    src      CHANGES
               src/main util.c
  Log:
  	ap_cfg_getline() was wont to remove leading and trailing whitespace
  	and compressing multiple tabs and spaces to a single space.  The
  	former two are fine, but the last really hoses quoted strings
  	in config files - so out it goes.  If this breaks anything (nothing
  	noticed yet), we can just revert it..
  
  PR:		1645
  Reviewed by:	Ralf Engelschall, Brian Behlendorf
  
  Revision  Changes    Path
  1.1002    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1001
  retrieving revision 1.1002
  diff -u -r1.1001 -r1.1002
  --- CHANGES	1998/08/03 21:51:37	1.1001
  +++ CHANGES	1998/08/05 01:36:35	1.1002
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.2
   
  +  *) Cure ap_cfg_getline() of its nasty habit of compressing internal
  +     whitespace in input lines -- including within quoted strings.
  +     [Ken Coar]
  +
     *) Cleanup of the PrintPath/PrintPathOS2 helper functions. Avoid
        the ugly use of an env. variable and use command-line args for
        alternate $PATH. Make more like advanced 'type's as well.
  
  
  
  1.127     +3 -15     apache-1.3/src/main/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/main/util.c,v
  retrieving revision 1.126
  retrieving revision 1.127
  diff -u -r1.126 -r1.127
  --- util.c	1998/08/03 09:15:00	1.126
  +++ util.c	1998/08/05 01:36:40	1.127
  @@ -863,26 +863,14 @@
   	    break;
   	}
   
  -	/* Compress the line, reducing all blanks and tabs to one space.
  +	/*
   	 * Leading and trailing white space is eliminated completely
   	 */
  -	src = dst = buf;
  +	src = buf;
   	while (ap_isspace(*src))
   	    ++src;
  -	while (*src != '\0')
  -	{
  -	    /* Copy words */
  -	    while (!ap_isspace(*dst = *src) && *src != '\0') {
  -		++src;
  -		++dst;
  -	    }
  -	    if (*src == '\0') break;
  -	    *dst++ = ' ';
  -	    while (ap_isspace(*src))
  -		++src;
  -	}
  -	*dst = '\0';
   	/* blast trailing whitespace */
  +	dst = &src[strlen(src)];
   	while (--dst >= buf && ap_isspace(*dst))
   	    *dst = '\0';