summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genlang12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/genlang b/tools/genlang
index 22d020fe5a..81d5066453 100755
--- a/tools/genlang
+++ b/tools/genlang
@@ -121,6 +121,8 @@ if(!$target && !$update && !$sortfile) {
121 print STDERR "Please specify a target (with -t)!\n"; 121 print STDERR "Please specify a target (with -t)!\n";
122 exit; 122 exit;
123} 123}
124my @target_parts = split ':', $target;
125
124my $verbose=$v; 126my $verbose=$v;
125 127
126my %id; # string to num hash 128my %id; # string to num hash
@@ -149,9 +151,6 @@ sub trim {
149sub match { 151sub match {
150 my ($string, $pattern)=@_; 152 my ($string, $pattern)=@_;
151 153
152 $pattern =~ s/\*/.*/g;
153 $pattern =~ s/\?/./g;
154
155 return ($string =~ /^$pattern\z/); 154 return ($string =~ /^$pattern\z/);
156} 155}
157 156
@@ -183,9 +182,12 @@ sub parsetarget {
183 my @all= split(" *, *", $n); 182 my @all= split(" *, *", $n);
184 my $test; 183 my $test;
185 for $test (@all) { 184 for $test (@all) {
185 $test =~ s/\*/.*/g;
186 $test =~ s/\?/./g;
187
186# print "TEST ($debug) $target for $test\n"; 188# print "TEST ($debug) $target for $test\n";
187 for my $part (split(":", $target)) { 189 for my $part (@target_parts) {
188 if(match($part, $test)) { 190 if($part =~ /^$test\z/) {
189 $string = $v; 191 $string = $v;
190# print "MATCH: $test => $v\n"; 192# print "MATCH: $test => $v\n";
191 $$strref = $string; 193 $$strref = $string;