From 3590f319ea80d8a153eba50be0b45bc5e6b87ef8 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 9 Nov 2007 14:59:21 +0100 Subject: Fix : ``500 Internal Server Error'' with *Preview* when creating new pages. --- .library/IkiWiki/Plugin/texinfo.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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}, -- cgit v1.2.3