forked from len0rd/rockbox
Revert r29494 as It is a) buggy b) doesn't seem to do any good in terms of speed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29495 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c9b0044274
commit
d233066155
1 changed files with 15 additions and 6 deletions
|
@ -148,6 +148,16 @@ sub trim {
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub match {
|
||||||
|
my ($string, $pattern)=@_;
|
||||||
|
|
||||||
|
return ($string =~ /^$pattern\z/);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub blank {
|
||||||
|
# nothing to do
|
||||||
|
}
|
||||||
|
|
||||||
my %head;
|
my %head;
|
||||||
sub header {
|
sub header {
|
||||||
my ($full, $n, $v)=@_;
|
my ($full, $n, $v)=@_;
|
||||||
|
@ -171,14 +181,13 @@ sub parsetarget {
|
||||||
my $string;
|
my $string;
|
||||||
my @all= split(" *, *", $n);
|
my @all= split(" *, *", $n);
|
||||||
my $test;
|
my $test;
|
||||||
my $regexp;
|
|
||||||
for $test (@all) {
|
for $test (@all) {
|
||||||
$test =~ s/\*/.*/g;
|
$test =~ s/\*/.*/g;
|
||||||
$test =~ s/\?/./g;
|
$test =~ s/\?/./g;
|
||||||
$regexp = qr/^$test\z/;
|
|
||||||
# print "TEST ($debug) $target for $test\n";
|
# print "TEST ($debug) $target for $test\n";
|
||||||
for my $part (@target_parts) {
|
for my $part (@target_parts) {
|
||||||
if($part =~ $regexp) {
|
if($part =~ /^$test\z/) {
|
||||||
$string = $v;
|
$string = $v;
|
||||||
# print "MATCH: $test => $v\n";
|
# print "MATCH: $test => $v\n";
|
||||||
$$strref = $string;
|
$$strref = $string;
|
||||||
|
@ -224,7 +233,7 @@ if($english) {
|
||||||
while(<ENG>) {
|
while(<ENG>) {
|
||||||
|
|
||||||
# get rid of DOS newlines
|
# get rid of DOS newlines
|
||||||
$_ =~ tr/\r//d;
|
$_ =~ s/\r//g;
|
||||||
|
|
||||||
if($_ =~ /^ *\<phrase\>/) {
|
if($_ =~ /^ *\<phrase\>/) {
|
||||||
# this is the start of a phrase
|
# this is the start of a phrase
|
||||||
|
@ -400,7 +409,7 @@ while(<LANG>) {
|
||||||
$line++;
|
$line++;
|
||||||
|
|
||||||
# get rid of DOS newlines
|
# get rid of DOS newlines
|
||||||
$_ =~ tr/\r//d;
|
$_ =~ s/\r//g;
|
||||||
|
|
||||||
if($_ =~ /^( *\#|[ \t\n\r]*\z)/) {
|
if($_ =~ /^( *\#|[ \t\n\r]*\z)/) {
|
||||||
# comment or empty line - output it if it's part of the header
|
# comment or empty line - output it if it's part of the header
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue