[Po4a-commits] "po4a/lib/Locale/Po4a Po.pm,1.78,1.79"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Sat Sep 15 16:07:26 UTC 2007
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv6319/lib/Locale/Po4a
Modified Files:
Po.pm
Log Message:
Be stricter when parsing PO files. Add $ to the regular expressions.
Index: Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- Po.pm 7 Jul 2007 14:02:50 -0000 1.78
+++ Po.pm 15 Sep 2007 16:07:24 -0000 1.79
@@ -225,26 +225,26 @@
my ($msgid,$msgstr,$comment,$automatic,$reference,$flags,$buffer);
foreach my $line (split (/\n/,$msg)) {
$linenum++;
- if ($line =~ /^#\. ?(.*)/) { # Automatic comment
+ if ($line =~ /^#\. ?(.*)$/) { # Automatic comment
$automatic .= (defined($automatic) ? "\n" : "").$1;
- } elsif ($line =~ /^#: ?(.*)/) { # reference
+ } elsif ($line =~ /^#: ?(.*)$/) { # reference
$reference .= (defined($reference) ? "\n" : "").$1;
- } elsif ($line =~ /^#, ?(.*)/) { # flags
+ } elsif ($line =~ /^#, ?(.*)$/) { # flags
$flags .= (defined($flags) ? "\n" : "").$1;
- } elsif ($line =~ /^#(.*)/ || $line =~ /^#$/) { # Translator comments
+ } elsif ($line =~ /^#(.*)$/ || $line =~ /^#$/) { # Translator comments
$comment .= (defined($comment) ? "\n" : "").($1||"");
- } elsif ($line =~ /^msgid (".*")/) { # begin of msgid
+ } elsif ($line =~ /^msgid (".*")$/) { # begin of msgid
$buffer .= (defined($buffer) ? "\n" : "").$1;
- } elsif ($line =~ /^msgstr (".*")/) { # begin of msgstr, end of msgid
+ } elsif ($line =~ /^msgstr (".*")$/) { # begin of msgstr, end of msgid
$msgid = $buffer;
$buffer = "$1";
- } elsif ($line =~ /^(".*")/) { # continuation of a line
+ } elsif ($line =~ /^(".*")$/) { # continuation of a line
$buffer .= "\n$1";
} else {
warn wrap_ref_mod("$filename:$linenum", "po4a::po", dgettext("po4a", "Strange line: -->%s<--"), $line);
More information about the Po4a-commits
mailing list