From d5d5779f5bc70ed1b224ff57a147a5db25767d88 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 27 Jan 2010 15:00:02 +0100 Subject: [PATCH] Regex FTW! --- locale/de/locales.pl | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/locale/de/locales.pl b/locale/de/locales.pl index 324e50882..efe2659d9 100755 --- a/locale/de/locales.pl +++ b/locale/de/locales.pl @@ -531,22 +531,9 @@ sub scanmenu { } sub unescape_template_string { - my $in = shift; - my $out = ''; - my $escaped = 0; - - foreach my $char (split m//, $in) { - if ($escaped) { - $out .= $char; - $escaped = 0; - } elsif ($char eq '\\') { - $escaped = 1; - } else { - $out .= $char; - } - } - - return $out; + my $in = "$_[0]"; + $in =~ s/\\(.)/$1/g; + return $in; } sub scanhtmlfile { -- 2.20.1