[Po4a-commits] "po4a/lib/Locale/Po4a Sgml.pm,1.97,1.98"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Mon Nov 28 19:39:42 UTC 2005


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

Modified Files:
	Sgml.pm 
Log Message:
Do not fail when the file pointed by a system entity does not exist and
this entity is not used.
If the file does not exist and the entity is used, po4a will fail with an
"unrecognized prolog inclusion entity" error.


Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- Sgml.pm	27 Nov 2005 19:29:44 -0000	1.97
+++ Sgml.pm	28 Nov 2005 19:39:39 -0000	1.98
@@ -562,7 +562,7 @@
 	        # find the file.
 	        $origfile =~ s/(<!ENTITY\s*%\s*\Q$key\E\s+SYSTEM\s*")\Q$origfilename\E("\s*>)/$1$filename$2/gsi;
 	    }
-	    if (defined $ignored_inclusion{$key}) {
+	    if (defined $ignored_inclusion{$key} || !-e $filename) {
 		# We won't expand this entity.
 		# And we avoid nsgmls to do so.
 		$prolog = "$begin<!--{PO4A-ent-beg-$key}$filename".
@@ -642,7 +642,7 @@
 	    # the file.
 	    $origfile =~ s/(<!ENTITY\s+$key\s+SYSTEM\s*")\Q$origfilename\E("\s*>)/$1$filename$2/gsi;
 	}
-	if (not defined $ignored_inclusion{$2}) {
+	if ((not defined $ignored_inclusion{$2}) and (-e $filename)) {
 	$entincl{$key}{'filename'}=$filename;
 	# Preload the content of the entity
 	(-e $filename && open IN,"<$filename")  ||




More information about the Po4a-commits mailing list