build: rework i18n-scan.pl defined checks

This commit is contained in:
Jo-Philipp Wich 2012-04-02 23:57:11 +00:00
parent 4c48b56875
commit c024eca0fc

View file

@ -60,15 +60,11 @@ if( open F, "find @ARGV -type f '(' -name '*.htm' -o -name '*.lua' ')' |" )
if( $code =~ /^['"]/ ) if( $code =~ /^['"]/ )
{ {
while( defined $sub ) while( defined $sub && length($sub) > 0 )
{ {
( $sub, $code ) = extract_delimited($code, q{'"}, q{\s*(?:\.\.\s*)?}); ( $sub, $code ) = extract_delimited($code, q{'"}, q{\s*(?:\.\.\s*)?});
if( length($sub) < 1 ) { if( defined $sub && length($sub) > 2 )
undef $sub;
}
if( defined $sub )
{ {
$res .= substr $sub, 1, length($sub) - 2; $res .= substr $sub, 1, length($sub) - 2;
} }