From 748e144a16436db06378333b8a5137b4eeea89f0 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 29 Dec 2003 15:10:59 +0000 Subject: [PATCH] allow '%' escape; treat anything else as error --- libraries/librewrite/subst.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libraries/librewrite/subst.c b/libraries/librewrite/subst.c index ee32dbd76f..c96e15ce57 100644 --- a/libraries/librewrite/subst.c +++ b/libraries/librewrite/subst.c @@ -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++; -- 2.39.5