From d02b242596d2e35cdfd85da575d27011c99f4073 Mon Sep 17 00:00:00 2001 From: Marcus Habermehl (BMH1980) Date: Mon, 31 May 2010 11:46:53 +0200 Subject: [PATCH] Adding quotes to variables. This avoids errors if a file is containing whitespaces. --- agr-thumbnailer/agr-thumbnailer | 2 +- tex-thumbnailer/tex-thumbnailer | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/agr-thumbnailer/agr-thumbnailer b/agr-thumbnailer/agr-thumbnailer index dd40f27..f3e341a 100644 --- a/agr-thumbnailer/agr-thumbnailer +++ b/agr-thumbnailer/agr-thumbnailer @@ -23,7 +23,7 @@ ifile=$1 ofile=$2 size=$3 -filesize=`du ${ifile}` +filesize=`du "${ifile}"` # don't try and generate thumbnails of huge files... if [ ${filesize} -gt 30000 ]; then diff --git a/tex-thumbnailer/tex-thumbnailer b/tex-thumbnailer/tex-thumbnailer index ec69f49..aad25e8 100644 --- a/tex-thumbnailer/tex-thumbnailer +++ b/tex-thumbnailer/tex-thumbnailer @@ -28,7 +28,7 @@ size=$3 # the output file will be called ${file}.pdf where ${file}=`basename $ifile .tex` file=`basename "${ifile}" .tex` -dir=`dirname ${ifile}` +dir=`dirname "${ifile}"` mkdir -p "/tmp/${file}" tmpfile="/tmp/${file}/${file}.pdf" @@ -48,9 +48,9 @@ if [ $C2 -lt "1" ]; then fi cd "${dir}" -pdflatex -interaction=nonstopmode -output-directory=/tmp/${file} "$ifile" +pdflatex -interaction=nonstopmode -output-directory="/tmp/${file}" "$ifile" -if [ ! -f ${tmpfile} ]; then +if [ ! -f "${tmpfile}" ]; then echo "** pdflatex has not made the PDF file." echo "** Is pdflatex installed?" exit 1 @@ -59,6 +59,6 @@ fi convert "pdf:${tmpfile}[0]" -scale "$sizex$size" "png:${ofile}" # clean up temporary files -rm -r /tmp/${file} +rm -r "/tmp/${file}" exit 0 -- 1.7.1