From 03e90f841c4ae8943e7153f6c39283f05d9c5b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20H=C3=A4ggqvist?= Date: Sun, 25 Jan 2009 15:32:03 +0000 Subject: [PATCH] Escape strings for use in matches. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19852 a1c6a512-1295-4272-9138-f99709370657 --- tools/langtool.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/langtool.pl b/tools/langtool.pl index fe0c25bd39..59db1cf8a5 100755 --- a/tools/langtool.pl +++ b/tools/langtool.pl @@ -194,13 +194,13 @@ foreach my $file (@ARGV) { elsif ($changetarget) { # Change target if set and it's the same as $from if ($id ne "" and grep(/$id/, @ids) and $location =~ /source|dest|voice/ and $target eq $from) { - $line =~ s/$from/$to/; + $line =~ s/\Q$from/$to/; } } elsif ($changesource) { # Change string if $target is set and matches $s_target if ($id ne "" and grep(/$id/, @ids) and $target eq $s_target and $location eq "source") { - $line =~ s/$string/$to/; + $line =~ s/\Q$string/$to/; } } elsif ($changedesc) {