summaryrefslogtreecommitdiff
path: root/.library
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2007-11-09 14:59:21 +0100
committerThomas Schwinge <tschwinge@gnu.org>2007-11-09 14:59:21 +0100
commit3590f319ea80d8a153eba50be0b45bc5e6b87ef8 (patch)
tree6082866eb98ab692648f60ff7e1e861c13260993 /.library
parentad7e4647e7ecc12b1f21cb8a9f687bfab904d416 (diff)
Fix <http://git.ikiwiki.info/?p=ikiwiki;a=commitdiff;h=cd4bc7c58086bbd61a2260e405eb7cb00134140c>: ``500 Internal Server Error'' with *Preview* when creating new pages.
Diffstat (limited to '.library')
-rw-r--r--.library/IkiWiki/Plugin/texinfo.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/.library/IkiWiki/Plugin/texinfo.pm b/.library/IkiWiki/Plugin/texinfo.pm
index 8df2e38c..8c651160 100644
--- a/.library/IkiWiki/Plugin/texinfo.pm
+++ b/.library/IkiWiki/Plugin/texinfo.pm
@@ -126,6 +126,20 @@ sub htmlize (@)
my %params = @_;
my $page = $params{page};
+ my $home;
+ if (defined $pagesources{$page})
+ {
+ $home = $config{srcdir} . '/' . dirname ($pagesources{$page});
+ }
+ else
+ {
+ # This happens in the CGI web frontent, when freshly creating a
+ # `texi'-type page and selecting to ``Preview'' the page before doing a
+ # ``Save Page''.
+# TODO.
+ $home = $config{srcdir};
+ }
+
my $pid;
my $sigpipe = 0;
$SIG{PIPE} = sub
@@ -153,7 +167,7 @@ sub htmlize (@)
# We might be run from a directory different from the one the
# `.texi' file is stored in.
# TODO. Should we `cd' to this directory instead?
- '-P', $config{srcdir} . '/' . dirname ($pagesources{$page}),
+ '-P', $home,
# TODO. Adding the following allows for putting files like `gpl.texinfo' into
# the top-level wiki directory.
'-I', $config{srcdir},