You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Paul Sutton <pa...@awe.com> on 1999/04/14 15:36:08 UTC

[PATCH] Quotes removed from defines in ap_config_auto.h

If you setup an option like

TARGET=\"apached\"

in Configuration and run Configure, you get

#define TARGET apached

in ap_config_auto.h. It loses the quoting, which makes it difficult to
use in modules as a string value (e.g. "my name is " TARGET would fail).

This patch fixes this so that quotes are preserved, and you get

#define TARGET "apached"

The same problem also occurs on definitions on EXTRA_CFLAGS, e.g.
EXTRA_CLAGS=-DSTRING=\"value\".

Index: Configure
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/Configure,v
retrieving revision 1.337
diff -u -r1.337 Configure
--- Configure	1999/03/30 08:58:33	1.337
+++ Configure	1999/04/14 13:22:49
@@ -1827,7 +1827,7 @@
 TEXTRA_CFLAGS=`egrep '^EXTRA_CFLAGS=' Makefile.config | tail -1 |\
 	       sed -e 's;^EXTRA_CFLAGS=;;' -e 's;\`.*\`;;'`
 tmpstr=`echo $CFLAGS $TEXTRA_CFLAGS |\
-	sed -e 's;[ 	]\([+-]\);!\1;g' -e 's/\\\"/\"/g' -e 's/\([^\\]\)"/\1/g'`
+	sed -e 's;[ 	]\([+-]\);!\1;g' -e 's/\([^\\]\)"/\1/g' -e 's/\\\"/\"/g'`
 OIFS="$IFS"
 IFS='!'
 for cflag in $tmpstr; do

In the original, anything of the form \" is replaced by ", then any
" not preceeded by a \ is removed, so \" is always removed.

The change re-orders this, so that a " not preceeded by a \ is removed,
and then \" is replaced by ".

Paul