From: Jo-Philipp Wich Date: Mon, 2 Apr 2012 23:57:11 +0000 (+0000) Subject: build: rework i18n-scan.pl defined checks X-Git-Tag: 0.11.0~923 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=c024eca0fc232957077038dbdda0d630a11b4484 build: rework i18n-scan.pl defined checks --- diff --git a/build/i18n-scan.pl b/build/i18n-scan.pl index 3f7327109..1243545ac 100755 --- a/build/i18n-scan.pl +++ b/build/i18n-scan.pl @@ -60,15 +60,11 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" ) if( $code =~ /^['"]/ ) { - while( defined $sub ) + while( defined $sub && length($sub) > 0 ) { ( $sub, $code ) = extract_delimited($code, q{'"}, q{\s*(?:\.\.\s*)?}); - if( length($sub) < 1 ) { - undef $sub; - } - - if( defined $sub ) + if( defined $sub && length($sub) > 2 ) { $res .= substr $sub, 1, length($sub) - 2; }