]> git.sur5r.net Git - openldap/blobdiff - libraries/librewrite/map.c
Fix up abandon merge. Hallvard will holler if I get this wrong. :-)
[openldap] / libraries / librewrite / map.c
index 2180d8907757164816ad4c23e19b8babe54a5fe2..8db54af13711b89701804bb6fdcf5a214cf20012 100644 (file)
@@ -245,19 +245,20 @@ rewrite_map_parse(
        for ( p = string, cnt = 1; p[ 0 ] != '\0' && cnt > 0; p++ ) {
                if ( p[ 0 ] == REWRITE_SUBMATCH_ESCAPE ) {
                        /*
-                        * '\' marks the beginning of a new map
+                        * '%' marks the beginning of a new map
                         */
                        if ( p[ 1 ] == '{' ) {
                                cnt++;
                        /*
-                        * '\' followed by a digit may mark the beginning
+                        * '%' followed by a digit may mark the beginning
                         * of an old map
                         */
                        } else if ( isdigit( (unsigned char) p[ 1 ] ) && p[ 2 ] == '{' ) {
                                cnt++;
                                p++;
                        }
-                       p++;
+                       if ( p[ 1 ] != '\0' )
+                               p++;
                } else if ( p[ 0 ] == '}' ) {
                        cnt--;
                }