Protect input parameter file name with double quotes every where in case it contains white space. Closes issue #28
This commit is contained in:
parent
13d550a40e
commit
7b803170c2
@ -84,7 +84,7 @@ umask 77
|
||||
|
||||
checkcmds xsltproc
|
||||
|
||||
xsltproc - $infile <<EOF
|
||||
xsltproc - "$infile" <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
|
||||
@ -86,7 +86,7 @@ checkcmds sed
|
||||
# Delete everything from <div id="menu"> to <div id="main-page">
|
||||
# This prints an additional blank line at top which does not matter
|
||||
sed -n -e '1,/<div id="menu">/{x;p' -e '}' \
|
||||
-e '/<div id="main-page">/,$p' < $infile
|
||||
-e '/<div id="main-page">/,$p' < "$infile"
|
||||
|
||||
# exit normally
|
||||
exit 0
|
||||
|
||||
@ -114,7 +114,7 @@ else
|
||||
fi
|
||||
tmplink=$ttdir/rcldjvu_tmp$$.djvu
|
||||
rm -f $tmplink
|
||||
ln -s $infile $tmplink || exit 1
|
||||
ln -s "$infile" $tmplink || exit 1
|
||||
|
||||
cleanup()
|
||||
{
|
||||
|
||||
@ -145,6 +145,6 @@ END {
|
||||
# seem to be an issue with our brave html input handler...
|
||||
if test $? -eq 1 ; then
|
||||
if iscmd wvWare ; then
|
||||
wvWare --nographics --charset=utf-8 $infile
|
||||
wvWare --nographics --charset=utf-8 "$infile"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -79,7 +79,7 @@ umask 77
|
||||
|
||||
checkcmds xsltproc
|
||||
|
||||
xsltproc - $infile <<EOF
|
||||
xsltproc - "$infile" <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
|
||||
@ -138,7 +138,7 @@ NR == 1 {
|
||||
END {
|
||||
printf("</body></html>\n")
|
||||
}
|
||||
' < $infile
|
||||
' < "$infile"
|
||||
|
||||
# exit normally
|
||||
exit 0
|
||||
|
||||
@ -107,7 +107,7 @@ cleanup()
|
||||
trap cleanup EXIT HUP QUIT INT TERM
|
||||
|
||||
# Old kwd files are gzip/tar archibes. Newer ones are zip archives.
|
||||
if file $infile | grep -qi gzip ; then
|
||||
if file "$infile" | grep -qi gzip ; then
|
||||
# Unzip the input file and change to the unzipped directory
|
||||
gunzip < "$infile" | (cd $tmpdir/rclkwdtmp;tar xf -)
|
||||
else
|
||||
|
||||
@ -128,7 +128,7 @@ trap cleanup EXIT HUP QUIT INT TERM
|
||||
workdir=$tmpdir/rcllyxtmp
|
||||
case "$infile" in
|
||||
*/*) ;;
|
||||
*) infile=`pwd`/$infile;;
|
||||
*) infile=`pwd`/"$infile";;
|
||||
esac
|
||||
|
||||
binfile=`basename "$infile"`
|
||||
|
||||
@ -137,7 +137,7 @@ NR == 1 {
|
||||
END {
|
||||
printf("</body></html>\n")
|
||||
}
|
||||
' < $infile
|
||||
' < "$infile"
|
||||
|
||||
# exit normally
|
||||
exit 0
|
||||
|
||||
@ -106,7 +106,7 @@ sedjoinprog=':a
|
||||
#P;D'
|
||||
|
||||
# Extract description title author and keywords
|
||||
description=`sed -e "$sedjoinprog" < $infile | \
|
||||
description=`sed -e "$sedjoinprog" < "$infile" | \
|
||||
awk '
|
||||
/<DOCUMENT / {
|
||||
if (match($0, " COMMENTS=\"[^\"]+")) {
|
||||
@ -117,7 +117,7 @@ awk '
|
||||
}
|
||||
'`
|
||||
|
||||
title=`sed -e "$sedjoinprog" < $infile | \
|
||||
title=`sed -e "$sedjoinprog" < "$infile" | \
|
||||
awk '
|
||||
/<DOCUMENT / {
|
||||
if (match($0, " TITLE=\"[^\"]+")) {
|
||||
@ -128,7 +128,7 @@ awk '
|
||||
}
|
||||
'`
|
||||
|
||||
author=`sed -e "$sedjoinprog" < $infile | \
|
||||
author=`sed -e "$sedjoinprog" < "$infile" | \
|
||||
awk '
|
||||
/<DOCUMENT / {
|
||||
if (match($0, " AUTHOR=\"[^\"]+")) {
|
||||
@ -139,7 +139,7 @@ awk '
|
||||
}
|
||||
'`
|
||||
|
||||
keywords=`sed -e "$sedjoinprog" < $infile | \
|
||||
keywords=`sed -e "$sedjoinprog" < "$infile" | \
|
||||
awk '
|
||||
/<DOCUMENT / {
|
||||
if (match($0, " KEYWORDS=\"[^\"]+")) {
|
||||
@ -165,7 +165,7 @@ cat <<EOF
|
||||
EOF
|
||||
|
||||
|
||||
sed -e ':a' -e '/[^>] *$/N; s/\n/ /; ta' < $infile | \
|
||||
sed -e ':a' -e '/[^>] *$/N; s/\n/ /; ta' < "$infile" | \
|
||||
awk '
|
||||
/<ITEXT / {
|
||||
if (match($0, " CH=\"[^\"]+")) {
|
||||
|
||||
@ -86,7 +86,7 @@ checkcmds sed
|
||||
# Delete everything from <div id="menu"> to <div id="main-page">
|
||||
# This prints an additional blank line at top which does not matter
|
||||
sed -n -e '1,/<div id="menu">/{x;p' -e '}' \
|
||||
-e '/<div id="main-page">/,$p' < $infile
|
||||
-e '/<div id="main-page">/,$p' < "$infile"
|
||||
|
||||
# exit normally
|
||||
exit 0
|
||||
|
||||
@ -79,7 +79,7 @@ umask 77
|
||||
|
||||
checkcmds xsltproc
|
||||
|
||||
xsltproc - $infile <<EOF
|
||||
xsltproc - "$infile" <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user