no need to use a stack

This commit is contained in:
Yann Dirson 2005-05-08 11:59:04 +00:00
parent e28d930e4b
commit d9ce1d893b

View file

@ -27,18 +27,18 @@ chdir $toplevel;
foreach my $file (@ARGV) {
open (FILE, "<$file") or die "cannot read from $file";
my $readingattack = 0;
my @domainstack = ($initialdomain);
my $currentdomain = $initialdomain;
LINE: while (<FILE>) {
# change the current textdomain when hitting the directive
if (m/\s*\#textdomain\s+(\S+)/) {
unshift @domainstack, $1;
$currentdomain = $1;
next LINE;
}
# skip other # lines as comments
next LINE if m/^\s*\#/ and !defined $str;
next LINE unless $domainstack[0] eq $domain;
next LINE unless $currentdomain eq $domain;
if (!defined $str and m/^(?:[^\"]*?)((?:_\s*)?)\"([^\"]*)\"(.*)/) {
# single-line quoted string