* 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
*/
*/
/* 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
/*
* 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;