]> git.sur5r.net Git - openldap/commitdiff
allow '$' as action prefix instead of '%'; backward compatibility is preserved
authorPierangelo Masarati <ando@openldap.org>
Wed, 10 Mar 2004 19:21:39 +0000 (19:21 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 10 Mar 2004 19:21:39 +0000 (19:21 +0000)
libraries/librewrite/map.c
libraries/librewrite/rewrite-int.h
libraries/librewrite/subst.c

index c94c7bf53090e3480f402db660c7a3d0c1fd043b..d8ba01cdb23b70dfc0edb554b76f0a86d96536f6 100644 (file)
@@ -51,7 +51,7 @@ rewrite_map_parse(
         * Go to the end of the map invocation (the right closing brace)
         */
        for ( p = string, cnt = 1; p[ 0 ] != '\0' && cnt > 0; p++ ) {
-               if ( p[ 0 ] == REWRITE_SUBMATCH_ESCAPE ) {
+               if ( IS_REWRITE_SUBMATCH_ESCAPE( p[ 0 ] ) ) {
                        /*
                         * '%' marks the beginning of a new map
                         */
index bf17fb3e20015930d2cb37d12001c89e55036cfb..798620ad41ba4a6687a1195b7d8ab4aa03896ce3 100644 (file)
  */
 /* the '\' conflicts with slapd.conf parsing */
 /* #define REWRITE_SUBMATCH_ESCAPE                     '\\' */
-#define REWRITE_SUBMATCH_ESCAPE                 '%'
+#define REWRITE_SUBMATCH_ESCAPE_ORIG           '%'
+#define REWRITE_SUBMATCH_ESCAPE                        '$'
+#define IS_REWRITE_SUBMATCH_ESCAPE(c) \
+       ((c) == REWRITE_SUBMATCH_ESCAPE || (c) == REWRITE_SUBMATCH_ESCAPE_ORIG)
 
 /*
  * REGEX flags
index 1ec0af7dc923fe2613eaf0abdbb3696117b95ee3..3fb2ae24766ad0199e140d7169481a20eacb59a2 100644 (file)
@@ -55,11 +55,11 @@ rewrite_subst_compile(
                /*
                 * Keep only single escapes '%'
                 */
-               if ( p[ 0 ] != REWRITE_SUBMATCH_ESCAPE ) {
+               if (  !IS_REWRITE_SUBMATCH_ESCAPE( p[ 0 ] ) ) {
                        continue;
                } 
 
-               if ( p[ 1 ] == REWRITE_SUBMATCH_ESCAPE ) {
+               if (  IS_REWRITE_SUBMATCH_ESCAPE( p[ 1 ] ) ) {
                        /* Pull &p[1] over p, including the trailing '\0' */
                        AC_MEMCPY((char *)p, &p[ 1 ], strlen( p ) );
                        continue;