httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject [PATCH] Consistent escaping in LogFormat
Date Sat, 05 Feb 2000 13:57:35 GMT

The following patch allows one to consistently escape characters in
LogFormat strings by prefixing them with the escape backslash ("\x").
This especially allows one now to also insert percent characters via
"\%" (see PR#5696). I would have comitted it before 1.3.12, but I've
less time to test it in depth and I don't want to commit perhaps risky
or incorrect patches myself just in front of a release. The RM should
have a deeper look and review this before 1.3.12. Thanks.

Yours,
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Index: CHANGES
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/CHANGES,v
retrieving revision 1.1509
diff -u -r1.1509 CHANGES
--- CHANGES	2000/02/05 12:33:13	1.1509
+++ CHANGES	2000/02/05 13:54:22
@@ -1,5 +1,10 @@
 Changes with Apache 1.3.12
 
+  *) Allow one to consistently escape characters in LogFormat strings 
+     by prefixing them with the escape backslash ("\x"). This especially 
+     allows one now to also insert percent characters via "\%".
+     [Monte Ohrt <monte@ispi.net>, Ralf S. Engelschall] PR#5696
+
   *) Make implementation/descriptions of the FLAG directives
      AuthAuthoritative, MetaFiles and ExtendedStatus consistent with
      documentation and the standard way of implementation those directives.
Index: modules/standard/mod_log_config.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/modules/standard/mod_log_config.c,v
retrieving revision 1.81
diff -u -r1.81 mod_log_config.c
--- modules/standard/mod_log_config.c	2000/02/02 20:44:04	1.81
+++ modules/standard/mod_log_config.c	2000/02/05 13:53:10
@@ -594,9 +594,7 @@
 	else {
 	    s++;
 	    switch (*s) {
-	    case '\\':
-		*d++ = '\\';
-		s++;
+	    case '\0':
 		break;
 	    case 'n':
 		*d++ = '\n';
@@ -608,12 +606,7 @@
 		break;
 	    default:
 		/* copy verbatim */
-		*d++ = '\\';
-		/*
-		 * Allow the loop to deal with this *s in the normal
-		 * fashion so that it handles end of string etc.
-		 * properly.
-		 */
+		*d++ = *s++;
 		break;
 	    }
 	}

Mime
View raw message