X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=build%2Fi18n-scan.pl;h=899d90d22c282ada2e203cc249a75a52aa51aa83;hp=1243545ac5134b2ef371257264e904b92ef6c411;hb=697db81246bf9e3256c7217a00ee4e7757c87077;hpb=c024eca0fc232957077038dbdda0d630a11b4484 diff --git a/build/i18n-scan.pl b/build/i18n-scan.pl index 1243545ac..899d90d22 100755 --- a/build/i18n-scan.pl +++ b/build/i18n-scan.pl @@ -28,6 +28,7 @@ sub dec_tpl_str $s =~ s/[\s\n]+/ /g; $s =~ s/^ //; $s =~ s/ $//; + $s =~ s/\\/\\\\/g; return $s; } @@ -60,7 +61,7 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" ) if( $code =~ /^['"]/ ) { - while( defined $sub && length($sub) > 0 ) + while( defined $sub ) { ( $sub, $code ) = extract_delimited($code, q{'"}, q{\s*(?:\.\.\s*)?}); @@ -68,6 +69,10 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" ) { $res .= substr $sub, 1, length($sub) - 2; } + else + { + undef $sub; + } } } elsif( $code =~ /^(\[=*\[)/ )