summaryrefslogtreecommitdiff
path: root/dquote_static.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-01-06 22:03:09 -0700
committerKarl Williamson <public@khwilliamson.com>2013-01-11 11:50:35 -0700
commitb8de99caf269c77d01411e0f81d45f696af02dd2 (patch)
treea92b9c41a42742039b4fc3de5fa05ed7b8659e23 /dquote_static.c
parent00ce556345c5faa3eb42f47f2a510d07b5f3d7c8 (diff)
downloadperl-b8de99caf269c77d01411e0f81d45f696af02dd2.tar.gz
Better error pos for grok_bslash_[xo]
These functions advance the parse pointer for the caller. The regex code has the infrastructure to output a marker as to where the error was. This commit simply moves the parse pointer past all the legal digits in the input, which are likely supposed to be part of the number, which makes it likely that the missing right brace point is just past those.
Diffstat (limited to 'dquote_static.c')
-rw-r--r--dquote_static.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/dquote_static.c b/dquote_static.c
index fa8e354246..d928e6757c 100644
--- a/dquote_static.c
+++ b/dquote_static.c
@@ -130,6 +130,9 @@ S_grok_bslash_o(pTHX_ char **s, UV *uv, const char** error_msg,
e = strchr(*s, '}');
if (!e) {
(*s)++; /* Move past the '{' */
+ while (isOCTAL(**s)) { /* Position beyond the legal digits */
+ (*s)++;
+ }
*error_msg = "Missing right brace on \\o{";
return FALSE;
}
@@ -209,6 +212,9 @@ S_grok_bslash_x(pTHX_ char **s, UV *uv, const char** error_msg,
e = strchr(*s, '}');
if (!e) {
(*s)++; /* Move past the '{' */
+ while (isXDIGIT(**s)) { /* Position beyond the legal digits */
+ (*s)++;
+ }
/* XXX The corresponding message above for \o is just '\\o{'; other
* messages for other constructs include the '}', so are inconsistent.
*/