substr() assumes utf8 without say-so
authorLarry Wall <larry@wall.org>
Fri, 7 Aug 1998 12:25:12 +0000 (05:25 -0700)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 8 Aug 1998 22:42:29 +0000 (22:42 +0000)
Message-Id: <199808071925.MAA13436@wall.org>
Subject: [PATCH 5.005_50] substr bug?

p4raw-id: //depot/perl@1768

pp.c

diff --git a/pp.c b/pp.c
index 2d2aa4c..3accab2 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1839,6 +1839,8 @@ PP(pp_substr)
        else
            curlen = utfcurlen;
     }
+    else
+       utfcurlen = 0;
 
     if (pos >= arybase) {
        pos -= arybase;