diff options
author | Karl Williamson <khw@cpan.org> | 2016-07-15 22:06:49 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-07-16 17:42:39 -0600 |
commit | d555b9dd665a725cb821a516235ceaa30169c3e6 (patch) | |
tree | 6fb4f46050a7e90718d2a097085fbcc612efb351 /regcomp.c | |
parent | 72e868c8f167ec109319c7c8e60e236e34bd786f (diff) | |
download | perl-d555b9dd665a725cb821a516235ceaa30169c3e6.tar.gz |
regcomp.c: Improve -Dr output
This improves the output of a bracketed character class under /d that has
things that match only if not in utf8.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -20157,10 +20157,13 @@ S_put_charclass_bitmap_innards(pTHX_ SV *sv, _invlist_invert(only_utf8); _invlist_intersection(only_utf8, PL_UpperLatin1, &only_utf8); } + else if (not_utf8) { - if (not_utf8) { - _invlist_invert(not_utf8); - _invlist_intersection(not_utf8, PL_UpperLatin1, ¬_utf8); + /* If a code point matches iff the target string is not in UTF-8, + * then complementing the result has it not match iff not in UTF-8, + * which is the same thing as matching iff it is UTF-8. */ + only_utf8 = not_utf8; + not_utf8 = NULL; } if (only_utf8_locale) { |