[Po4a-commits] "po4a/lib/Locale/Po4a Sgml.pm,1.90,1.91"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Sun Nov 20 20:44:24 UTC 2005
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv26990/lib/Locale/Po4a
Modified Files:
Sgml.pm
Log Message:
When a master file is not in the current directory, the filenames must be
rewritten, not only for the file inclusion, but also for also for nsgmls.
Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- Sgml.pm 20 Nov 2005 20:10:10 -0000 1.90
+++ Sgml.pm 20 Nov 2005 20:44:21 -0000 1.91
@@ -529,11 +529,15 @@
# Preload the content of the entity.
my $key = $2;
my $filename=$3;
+ my $origfilename = $filename;
$prolog = $1.$4;
if ($filename !~ m%^/% && $mastername =~ m%/%) {
my $dir=$mastername;
$dir =~ s%/[^/]*$%%;
$filename="$dir/$filename";
+ # origfile also needs to be fixed otherwise nsgmls won't
+ # find the file.
+ $origfile =~ s/(<!ENTITY\s*%\s*\Q$key\E\s+SYSTEM\s*")\Q$origfilename\E("\s*>)/$1$filename$2/gsi;
}
(-e $filename && open IN,"<$filename") ||
die wrap_mod("po4a::sgml", dgettext("po4a", "Can't open %s (content of entity %s%s;): %s"),
@@ -596,11 +600,15 @@
if ($debug{'entities'});
my $key = $2;
my $filename = $3;
+ my $origfilename = $filename;
$searchprolog = $1.$4;
if ($filename !~ m%^/% && $mastername =~ m%/%) {
my $dir=$mastername;
$dir =~ s%/[^/]*$%%;
$filename="$dir/$filename";
+ # origfile also needs to be fixed otherwise nsgmls won't find
+ # the file.
+ $origfile =~ s/(<!ENTITY\s+$key\s+SYSTEM\s*")\Q$origfilename\E("\s*>)/$1$filename$2/gsi;
}
$entincl{$key}{'filename'}=$filename;
# Preload the content of the entity
More information about the Po4a-commits
mailing list