[Po4a-devel][CVS] po4a po4a,1.3,1.4
Martin Quinson
po4a-devel@lists.alioth.debian.org
Sun, 18 Jul 2004 06:02:55 +0000
Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv648
Modified Files:
po4a
Log Message:
Properly handle the escape of EOL; make a error message more explicit; accept declaration of document without translation
Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- po4a 17 Jul 2004 10:12:21 -0000 1.3
+++ po4a 18 Jul 2004 06:02:53 -0000 1.4
@@ -215,15 +215,16 @@
$nb++;
s/#.*//;
$line.=$_;
+ chomp($line);
next if ($line =~ s/\\$//);
next unless ($line =~ /\S/);
$line =~ s/ +/ /g;
$line =~ s/^ //;
$line =~ s/ $//;
- die sprintf("%s:%d: ".gettext("Syntax error.")."\n",$config_file,$nb)
- unless ($line =~ m/^\[([^\]]*)\] (\S+) (.*)?$/);
- my ($cmd,$main,$args)=($1,$2,$3);
+ die sprintf("%s:%d: ".gettext("Syntax error: %s")."\n",$config_file,$nb,$line)
+ unless ($line =~ m/^\[([^\]]*)\] (\S+) (.*)$/ || $line =~ m/^\[([^\]]*)\] (\S+)$/);
+ my ($cmd,$main,$args)=($1,$2,$3||"");
print "cmd=[$cmd]; main=$main; args=\"$args\"\n" if $debug;