summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-12-09 12:39:31 +0200
committerJarkko Hietaniemi <jhi@iki.fi>1998-12-29 11:32:26 +0000
commitc9f97d15d3a5d7fcbfc403087c4a4a450990ff7c (patch)
treefa4692437f8fa59c7d5edda5f32a44ca558d9a76 /regcomp.c
parentad94a51148da69b36625e16c155cd6147ed14f1a (diff)
downloadperl-c9f97d15d3a5d7fcbfc403087c4a4a450990ff7c.tar.gz
Warn on unrecognized alpha escapes.
To: perl5-porters@perl.org (Mailing list Perl5) Message-ID: <MLIST_199812090823.DAA17566@monk.mps.ohio-state.edu> p4raw-id: //depot/cfgperl@2516
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 2f39b279d8..82d2b8ef62 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1878,6 +1878,8 @@ tryagain:
FAIL("trailing \\ in regexp");
/* FALL THROUGH */
default:
+ /* Do not generate `unrecognized' warnings here, we fall
+ back into the quick-grab loop below */
goto defchar;
}
break;
@@ -2008,6 +2010,11 @@ tryagain:
FAIL("trailing \\ in regexp");
/* FALL THROUGH */
default:
+ if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) && isALPHA(*p))
+ warner(WARN_UNSAFE,
+ "/%.127s/: Unrecognized escape \\%c passed through",
+ PL_regprecomp,
+ *p);
goto normal_default;
}
break;