Skip to content

Commit

Permalink
tr/// doesn't null-terminate the result in some situations
Browse files Browse the repository at this point in the history
(from Gisle Aas)

p4raw-id: //depot/maint-5.6/perl@9551
  • Loading branch information
Gurusamy Sarathy committed Apr 5, 2001
1 parent 7609080 commit a49f40b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions doop.c
Expand Up @@ -179,6 +179,7 @@ S_do_trans_complex(pTHX_ SV *sv)/* SPC - NOT OK */
s++;
}
}
*d = '\0';
SvCUR_set(sv, d - dstart);
}
else { /* isutf8 */
Expand Down
7 changes: 6 additions & 1 deletion t/op/tr.t
Expand Up @@ -5,7 +5,7 @@ BEGIN {
@INC = '../lib';
}

print "1..51\n";
print "1..52\n";

$_ = "abcdefghijklmnopqrstuvwxyz";

Expand Down Expand Up @@ -296,3 +296,8 @@ print "ok 50\n";
($a = v300.196.172.302.197.172) =~ tr/\xc4-\xc8/\x{12c}-\x{130}/;
print "not " unless $a eq v300.300.172.302.301.172;
print "ok 51\n";

# misc
($a = "R0_001") =~ tr/R_//d;
print "not " if hex($a) != 1;
print "ok 52\n";

0 comments on commit a49f40b

Please sign in to comment.