From: Frédéric Marchal Date: Mon, 12 Mar 2012 09:14:25 +0000 (+0100) Subject: Display the offending regular expression if an error is detected X-Git-Tag: v2.3.3-pre1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3c57e9e4802a4c0a103e7c44858a349594a4235;p=thirdparty%2Fsarg.git Display the offending regular expression if an error is detected If a regular expression is invalid, the actual regular expression is displayed in the error message in addition to the error message from libpcre. The user will know what regular expression failed. --- diff --git a/url.c b/url.c index ec5b436..3cdba73 100644 --- a/url.c +++ b/url.c @@ -490,7 +490,7 @@ static int Alias_StoreRegexp(char *buf) new_alias->Next=NULL; new_alias->Re=pcre_compile(buf,0,&PcreError,&ErrorOffset,NULL); if (new_alias->Re==NULL) { - debuga(_("Failed to compile the regular expression: %s\n"),PcreError); + debuga(_("Failed to compile the regular expression \"%s\": %s\n"),buf,PcreError); free(new_alias); return(-1); }