Skip to content

Commit

Permalink
PATCH: [perl #113584] tr/// multiple transliterations
Browse files Browse the repository at this point in the history
Commit 4de6d20 failed to take into
consideration tr///.
  • Loading branch information
Karl Williamson committed Jun 11, 2012
1 parent 72a8661 commit cb6d347
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/utf8_heavy.pl
Expand Up @@ -533,10 +533,10 @@ ($)
if ($list && ! $list_is_from_mktables) {
my $taint = substr($list,0,0); # maintain taint

# Separate the extras from the code point list, and for
# user-defined properties, make sure the latter are well-behaved
# for downstream code.
if ($user_defined) {
# Separate the extras from the code point list, and make sure
# user-defined properties and tr/// are well-behaved for
# downstream code.
if ($user_defined || $none) {
my @tmp = split(/^/m, $list);
my %seen;
no warnings;
Expand Down
12 changes: 11 additions & 1 deletion t/op/tr.t
@@ -1,12 +1,14 @@
# tr.t

use utf8;

BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
}

plan tests => 130;
plan tests => 131;

my $Is_EBCDIC = (ord('i') == 0x89 & ord('J') == 0xd1);

Expand Down Expand Up @@ -515,4 +517,12 @@ SKIP: {
ok 1;
}

{ # [perl #113584]

my $x = "Perlα";
$x =~ tr/αα/βγ/;
note $x;
is($x, "Perlβ", "Only first of multiple transliterations is used");
}

1;

0 comments on commit cb6d347

Please sign in to comment.