diff options
author | Karl Williamson <khw@cpan.org> | 2022-03-29 04:38:30 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-04-01 09:19:55 -0600 |
commit | 1061cdbabb82e32485a24378c01f81d4cd9c3ea0 (patch) | |
tree | c2bec836c2634db6ba12d6d656125ebae96e7072 /toke.c | |
parent | a158cd66c53b18813b4afae9fc71e3cb355ed7a6 (diff) | |
download | perl-1061cdbabb82e32485a24378c01f81d4cd9c3ea0.tar.gz |
toke.c: Don't assume is UTF-8 when it might not be
This code only works by coincidence on ASCII platforms, due to the
chance ways the underlying UTF-8 is represented. But it definitely
doesn't on EBCDIC. Test before assuming is UTF-8.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -11449,7 +11449,9 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int UTF8fARG(UTF, delim_byte_len, open_delim_str)); } - close_delim_code = valid_utf8_to_uvchr((U8 *) close_delim_str, NULL); + close_delim_code = (UTF) + ? valid_utf8_to_uvchr((U8 *) close_delim_str, NULL) + : * (U8 *) close_delim_str; } else { /* Here, the delimiter isn't paired, hence the close is the same as the open; and has aready been set up. But make sure it isn't |