[Po4a-devel][CVS] po4a/lib/Locale/Po4a TransTractor.pm,1.22,1.23

Martin Quinson po4a-devel@lists.alioth.debian.org
Sun, 18 Jul 2004 06:08:28 +0000


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv881/lib/Locale/Po4a

Modified Files:
	TransTractor.pm 
Log Message:
Warning when the addendum name is omited is good, but we should return instead of proceeding anyway (and die in awfull way)

Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- TransTractor.pm	16 Jul 2004 23:15:15 -0000	1.22
+++ TransTractor.pm	18 Jul 2004 06:08:26 -0000	1.23
@@ -531,9 +531,11 @@
 sub addendum {
     my ($self,$filename) = @_;
     
-    warn(dgettext("po4a",
-		  "Can't insert addendum when not given the filename")."\n")
-	unless $filename;
+    unless ($filename) {
+	warn(dgettext("po4a",
+	    "Can't insert addendum when not given the filename")."\n")
+	return 0;
+    }
   
     my ($errcode,$mode,$position,$boundary,$bmode,$lang,$content)=
 	addendum_parse($filename);