diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-07-30 16:10:11 +0530 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2016-09-29 22:57:55 +0200 |
commit | 4ba537d4c73a0d4534eeac39ecc3a36793ca1c63 (patch) | |
tree | 979e713809e2d3fc8d393b8f6c8695b40d9cbb72 /gtkdoc-mkpdf.in | |
parent | 7efd7e784e90357c4f301e85e03c2a91c81ac3b6 (diff) | |
download | gtk-doc-4ba537d4c73a0d4534eeac39ecc3a36793ca1c63.tar.gz |
mkhtml/pdf: Fix quoting of search path
We need to do quoting using POSIX sh syntax, so this fix is uglier than simply
using bash arrays.
This still leaves the quoting of imgdirs in mkpdf and I can't see a non-terrible
way to quote that in POSIX sh syntax, but that is usually a relative path and is
less likely to have spaces.
https://bugzilla.gnome.org/show_bug.cgi?id=769125
Diffstat (limited to 'gtkdoc-mkpdf.in')
-rw-r--r-- | gtkdoc-mkpdf.in | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gtkdoc-mkpdf.in b/gtkdoc-mkpdf.in index 8d663b7..9b39ddf 100644 --- a/gtkdoc-mkpdf.in +++ b/gtkdoc-mkpdf.in @@ -77,14 +77,18 @@ else path_option='--directory' fi -# we could do "$path_option $PWD " -# to avoid needing rewriting entities that are copied from the header -# into docs under xml -if test "X$searchpath" = "X"; then - path_arg= -else - path_arg="$path_option $searchpath" -fi +# We need to use a wrapper because there's no other way to conditionally pass +# a `--path $searchpath` argument with proper quoting for the path +run_xsltproc() { + # we could do "$path_option $PWD " + # to avoid needing rewriting entities that are copied from the header + # into docs under xml + if test "X$searchpath" = "X"; then + @XSLTPROC@ 2>profile.txt "$@" + else + @XSLTPROC@ 2>profile.txt "$path_option" "$searchpath" "$@" + fi +} if $is_xml; then if test -n "@DBLATEX@"; then @@ -95,7 +99,7 @@ if $is_xml; then # -d : keep transient files (for debugging) # -P abc.def=$quiet : once the stylesheets have a quiet mode # xsltproc is already called with --xinclude - # does not work: --xslt-opts "$path_arg --nonet $@" + # does not work: --xslt-opts "$path_option $searchpath --nonet $@" dblatex_options="-o $module.pdf $imgdirs $document" #echo "calling: @DBLATEX@ $dblatex_options" if test $verbose = "0"; then @@ -109,12 +113,12 @@ if $is_xml; then fi else if test -n "@FOP@"; then - @XSLTPROC@ $path_arg --nonet --xinclude \ - --stringparam gtkdoc.bookname $module \ + run_xsltproc --nonet --xinclude \ + --stringparam gtkdoc.bookname "$module" \ --stringparam gtkdoc.version "@VERSION@" \ --stringparam chunk.quietly $quiet \ --stringparam chunker.output.quiet $quiet \ - "$@" -o $module.fo $gtkdocdir/gtk-doc-fo.xsl "$document" || cleanexit $? + "$@" -o "$module.fo" "$gtkdocdir/gtk-doc-fo.xsl" "$document" || cleanexit $? # fop dies too easily :( # @FOP@ $module.fo $module.pdf else |