[gtk-doc] mkhtml/pdf: quote document to allow spaces in filenames



commit 12adab6b0a28aec4008c6deed247bf944b5882f2
Author: Igor Gnatenko <ignatenko src gnome org>
Date:   Sun Aug 2 00:13:20 2015 +0300

    mkhtml/pdf: quote document to allow spaces in filenames
    
    Reference: https://bugzilla.gnome.org/show_bug.cgi?id=753145
    Signed-off-by: Igor Gnatenko <ignatenko src gnome org>

 gtkdoc-mkhtml.in |   10 +++++-----
 gtkdoc-mkpdf.in  |   16 ++++++++--------
 2 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/gtkdoc-mkhtml.in b/gtkdoc-mkhtml.in
index bbdb5c3..12aa9f2 100644
--- a/gtkdoc-mkhtml.in
+++ b/gtkdoc-mkhtml.in
@@ -27,7 +27,7 @@ while true; do
         X--help) usage; exit 0;;
         X--uninstalled) uninstalled=yes; shift;;
         X--verbose) verbose="1"; shift;;
-        X--path=*) searchpath=`echo $1 | sed s/.*=//`; shift;;
+        X--path=*) searchpath=`echo "$1" | sed s/.*=//`; shift;;
         X--*) shift;;
         X*) break;;
     esac
@@ -38,9 +38,9 @@ if test $# -lt 2; then
     exit 1
 fi
 
-module=$1
+module="$1"
 shift
-document=$1
+document="$1"
 shift
 
 quiet="1"
@@ -86,13 +86,13 @@ fi
 #echo @XSLTPROC@ $path_arg --nonet --xinclude \
 #    --stringparam gtkdoc.bookname $module \
 #    --stringparam gtkdoc.version "@VERSION@" \
-#    "$@" $gtkdocdir/gtk-doc.xsl $document
+#    "$@" $gtkdocdir/gtk-doc.xsl "$document"
 @XSLTPROC@ 2>profile.txt $profile_args $path_arg --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
diff --git a/gtkdoc-mkpdf.in b/gtkdoc-mkpdf.in
index b4ade2a..f221f05 100644
--- a/gtkdoc-mkpdf.in
+++ b/gtkdoc-mkpdf.in
@@ -19,7 +19,7 @@ EOF
 
 cleanexit() {
     rm -f $module.fo
-    exit $1
+    exit 1
 }
 
 # parse options, ignore unknown options for future extensions
@@ -34,8 +34,8 @@ while true; do
         X--help) usage; exit 0;;
         X--uninstalled) uninstalled=yes; shift;;
         X--verbose) verbose="1"; shift;;
-        X--path=*) searchpath=`echo $1 | sed s/.*=//`; shift;;
-        X--imgdir=*) imgdirs="$imgdirs -I `echo $1 | sed s/.*=//`"; shift;;
+        X--path=*) searchpath=`echo "$1" | sed s/.*=//`; shift;;
+        X--imgdir=*) imgdirs="$imgdirs -I `echo "$1" | sed s/.*=//`"; shift;;
         X--*) shift;;
         X*) break;;
     esac
@@ -46,9 +46,9 @@ if test $# -lt 2; then
     exit 1
 fi
 
-module=$1
+module="$1"
 shift
-document=$1
+document="$1"
 shift
 
 quiet="1"
@@ -96,7 +96,7 @@ if $is_xml; then
       # -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 $@"
-      dblatex_options="-o $module.pdf $imgdirs $document"
+      dblatex_options="-o $module.pdf $imgdirs \"$document\""
       #echo "calling: @DBLATEX@ $dblatex_options"
       if test $verbose = "0"; then
           @DBLATEX@ 2>&1 --help | grep  >/dev/null "\-\-quiet"
@@ -114,7 +114,7 @@ if $is_xml; then
             --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
@@ -125,7 +125,7 @@ if $is_xml; then
 else
     # not very good output
     # also for xxx-docs.sgml it will produce xxx-docs.pdf
-    docbook2pdf -e no-valid $document
+    docbook2pdf -e no-valid "$document"
 fi
 
 echo "timestamp" > pdf.stamp


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]