summaryrefslogtreecommitdiff
path: root/lib/Search
diff options
context:
space:
mode:
authorGisle Aas <aas@aas.no>1996-09-21 23:02:42 +0200
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-09-21 23:02:42 +0200
commitdf76f08a516b9dffbe3a228618a7a70f1393e5fc (patch)
treec4f8c80677272407b5c52826634e5a6b1a6acecc /lib/Search
parent66730be00e20f21554ddafe7899e27bc47edc3cb (diff)
downloadperl-df76f08a516b9dffbe3a228618a7a70f1393e5fc.tar.gz
look() in Search::Dict should use lc() istead of tr/A-Z/a-z/
The Search::Dict look() function should use the lc() function instead of tr/A-Z/a-z/. This will make folding of non-english letters work if the locale is set up correctly.
Diffstat (limited to 'lib/Search')
-rw-r--r--lib/Search/Dict.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Search/Dict.pm b/lib/Search/Dict.pm
index 295da6b31d..1cd5cf8a11 100644
--- a/lib/Search/Dict.pm
+++ b/lib/Search/Dict.pm
@@ -37,7 +37,7 @@ sub look {
my($size, $blksize) = @stat[7,11];
$blksize ||= 8192;
$key =~ s/[^\w\s]//g if $dict;
- $key =~ tr/A-Z/a-z/ if $fold;
+ $key = lc $key if $fold;
my($min, $max, $mid) = (0, int($size / $blksize));
while ($max - $min > 1) {
$mid = int(($max + $min) / 2);
@@ -47,7 +47,7 @@ sub look {
$_ = <FH>;
chop;
s/[^\w\s]//g if $dict;
- tr/A-Z/a-z/ if $fold;
+ $_ = lc $_ if $fold;
if (defined($_) && $_ lt $key) {
$min = $mid;
}
@@ -65,7 +65,7 @@ sub look {
or last;
chop;
s/[^\w\s]//g if $dict;
- y/A-Z/a-z/ if $fold;
+ $_ = lc $_ if $fold;
last if $_ ge $key;
}
seek(FH,$min,0);