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-mkhtml.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-mkhtml.in')
-rw-r--r-- | gtkdoc-mkhtml.in | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/gtkdoc-mkhtml.in b/gtkdoc-mkhtml.in index 12aa9f2..4e6e30e 100644 --- a/gtkdoc-mkhtml.in +++ b/gtkdoc-mkhtml.in @@ -52,9 +52,9 @@ if test $uninstalled = yes; then # this does not work from buiddir!=srcdir gtkdocdir=`dirname $0` # traditional Bourne shells may not support -e here, use -f - if test ! -f $gtkdocdir/gtk-doc.xsl; then + if test ! -f "$gtkdocdir/gtk-doc.xsl"; then # try to src dir (set from makefiles) too - if test -f $ABS_TOP_SRCDIR/gtk-doc.xsl; then + if test -f "$ABS_TOP_SRCDIR/gtk-doc.xsl"; then gtkdocdir=$ABS_TOP_SRCDIR fi fi @@ -68,31 +68,31 @@ else styledir=$gtkdocdir 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 $searchpath" -fi - # profiling profile_args="" if test "$GTKDOC_PROFILE" != ""; then profile_args="--profile" fi -#echo @XSLTPROC@ $path_arg --nonet --xinclude \ -# --stringparam gtkdoc.bookname $module \ -# --stringparam gtkdoc.version "@VERSION@" \ -# "$@" $gtkdocdir/gtk-doc.xsl "$document" -@XSLTPROC@ 2>profile.txt $profile_args $path_arg --nonet --xinclude \ - --stringparam gtkdoc.bookname $module \ +# 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 $profile_args "$@" + else + @XSLTPROC@ 2>profile.txt $profile_args --path "$searchpath" "$@" + fi +} + +run_xsltproc --nonet --xinclude \ + --stringparam gtkdoc.bookname "$module" \ --stringparam gtkdoc.version "@VERSION@" \ --stringparam chunk.quietly $quiet \ --stringparam chunker.output.quiet $quiet \ - "$@" $gtkdocdir/gtk-doc.xsl "$document" || exit $? + "$@" "$gtkdocdir/gtk-doc.xsl" "$document" || exit $? # profiling if test "$GTKDOC_PROFILE" != ""; then @@ -102,7 +102,7 @@ else fi # copy navigation images and stylesheets to html directory ... -cp -f $styledir/*.png $styledir/*.css ./ +cp -f "$styledir"/*.png "$styledir"/*.css ./ echo "timestamp" > ../html.stamp |