summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toke.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index 6264c5c612..369fa72978 100644
--- a/toke.c
+++ b/toke.c
@@ -11535,7 +11535,10 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int
}
/* Here, still in the middle of the string; copy this character */
- if (UTF && ! UTF8_IS_INVARIANT((U8) *s)) {
+ if (! UTF || UTF8_IS_INVARIANT((U8) *s)) {
+ *to++ = *s++;
+ }
+ else {
size_t this_char_len = UTF8SKIP(s);
Copy(s, to, this_char_len, char);
s += this_char_len;
@@ -11543,9 +11546,6 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int
d_is_utf8 = TRUE;
}
- else {
- *to++ = *s++;
- }
} /* End of loop through buffer */
/* Here, found end of the string, OR ran out of buffer: terminate the