This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Larry's fix for buggy propagation of utf8-ness in join(); add test
authorGurusamy Sarathy <gsar@cpan.org>
Mon, 24 Apr 2000 06:37:59 +0000 (06:37 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Mon, 24 Apr 2000 06:37:59 +0000 (06:37 +0000)
p4raw-id: //depot/perl@5920

doop.c
t/op/ver.t

diff --git a/doop.c b/doop.c
index 06b1b38..4224b0e 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -660,12 +660,9 @@ Perl_do_join(pTHX_ register SV *sv, SV *del, register SV **mark, register SV **s
     if (items-- > 0) {
        char *s;
 
-       if (*mark) {
-           s = SvPV(*mark, tmplen);
-           sv_setpvn(sv, s, tmplen);
-       }
-       else
-           sv_setpv(sv, "");
+       sv_setpv(sv, "");
+       if (*mark)
+           sv_catsv(sv, *mark);
        mark++;
     }
     else
index b08849f..5346f39 100755 (executable)
@@ -5,7 +5,7 @@ BEGIN {
     unshift @INC, "../lib";
 }
 
-print "1..22\n";
+print "1..23\n";
 
 my $test = 1;
 
@@ -72,6 +72,11 @@ print "not " unless sprintf("%*vb", "##", v1.22.333.4444)
     eq '1##10110##101001101##1000101011100';
 print "ok $test\n";  ++$test;
 
+print "not " unless sprintf("%vd", join("", map { chr }
+                                           unpack "U*", v2001.2002.2003))
+                   eq '2001.2002.2003';
+print "ok $test\n";  ++$test;
+
 {
     use bytes;
     print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108';