[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/utils wmlxgettext
From: |
Yann Dirson |
Subject: |
[Wesnoth-cvs-commits] wesnoth/utils wmlxgettext |
Date: |
Sun, 08 May 2005 08:30:04 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Yann Dirson <address@hidden> 05/05/08 12:30:04
Modified files:
utils : wmlxgettext
Log message:
made wmlxgettext to restore the textdomain on #enddef, to match the new
preprocessor behaviour
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/utils/wmlxgettext.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Patches:
Index: wesnoth/utils/wmlxgettext
diff -u wesnoth/utils/wmlxgettext:1.17 wesnoth/utils/wmlxgettext:1.18
--- wesnoth/utils/wmlxgettext:1.17 Sun May 8 12:14:40 2005
+++ wesnoth/utils/wmlxgettext Sun May 8 12:30:04 2005
@@ -28,10 +28,21 @@
open (FILE, "<$file") or die "cannot read from $file";
my $readingattack = 0;
my @domainstack = ($initialdomain);
+ my ($is_define, $macro_has_textdomain) = (0, 0);
LINE: while (<FILE>) {
+ # record a #define scope
+ if (m/\#define\>/) {
+ $is_define = 1; $macro_has_textdomain = 0;
+ next LINE;
+ } elsif (m/\#enddef\>/) {
+ $is_define = 0;
+ if ($macro_has_textdomain) { shift @domainstack; };
+ }
+
# change the current textdomain when hitting the directive
- if (m/\s*\#textdomain\s+(\S+)/) {
+ if (m/\#textdomain\s+(\S+)/) {
unshift @domainstack, $1;
+ if ($is_define) { $macro_has_textdomain = 1; };
next LINE;
}