]> git.sur5r.net Git - openldap/commitdiff
allow '%' escape; treat anything else as error
authorPierangelo Masarati <ando@openldap.org>
Mon, 29 Dec 2003 15:10:59 +0000 (15:10 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 29 Dec 2003 15:10:59 +0000 (15:10 +0000)
libraries/librewrite/subst.c

index ee32dbd76f96ec92df051759b29c5962c3a877ec..c96e15ce570d5817611e1dcc42598c87d5af36de 100644 (file)
@@ -160,6 +160,16 @@ rewrite_subst_compile(
                        submatch[ nsub ].ls_type =
                                REWRITE_SUBMATCH_MAP_W_ARG;
                        submatch[ nsub ].ls_map = map;
+
+               /*
+                * Escape '%' ...
+                */
+               } else if ( p[ 1 ] == '%' ) {
+                       AC_MEMCPY( &p[ 1 ], &p[ 2 ], strlen( &p[ 1 ] ) );
+                       continue;
+
+               } else {
+                       return NULL;
                }
 
                nsub++;