X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/5e0a247b35271159d629ea8562732e0993ed4594..7b0eb0b818a1e6a78e2d2fc8de6c6aec637cf47f:/dquote_static.c diff --git a/dquote_static.c b/dquote_static.c index 5a22993..da1b5b9 100644 --- a/dquote_static.c +++ b/dquote_static.c @@ -15,7 +15,11 @@ Pulled from regcomp.c. */ PERL_STATIC_INLINE I32 -S_regcurly(pTHX_ const char *s) +S_regcurly(pTHX_ const char *s, + const bool rbrace_must_be_escaped /* Should the terminating '} be + preceded by a backslash? This + is an abnormal case */ + ) { PERL_ARGS_ASSERT_REGCURLY; @@ -30,9 +34,10 @@ S_regcurly(pTHX_ const char *s) while (isDIGIT(*s)) s++; } - if (*s != '}') - return FALSE; - return TRUE; + + return (rbrace_must_be_escaped) + ? *s == '\\' && *(s+1) == '}' + : *s == '}'; } /* XXX Add documentation after final interface and behavior is decided */