Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19c7c84

Browse files
committed
Be a little more robust handling filenames.
1 parent 8923c72 commit 19c7c84

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Doc/tools/mkhowto.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ MAX_LINK_DEPTH=3
6262
MAX_SPLIT_DEPTH=8
6363

6464
build_html() {
65+
TEXFILE=`kpsewhich $1.tex`
6566
if [ "$ADDRESS" ] ; then
6667
latex2html -init_file $L2H_INIT_FILE \
6768
-address "$ADDRESS" \
@@ -70,10 +71,10 @@ build_html() {
7071
else
7172
latex2html -init_file $L2H_INIT_FILE \
7273
-link $MAX_LINK_DEPTH -split $MAX_SPLIT_DEPTH \
73-
$1 || exit $?
74+
-dir $1 $TEXFILE || exit $?
7475
fi
7576
if [ "$MAX_SPLIT_DEPTH" -ne 1 ] ; then
76-
(cd $FILE; $MYDIR/node2label.pl *.html) || exit $?
77+
(cd $1; $MYDIR/node2label.pl *.html) || exit $?
7778
fi
7879
}
7980

@@ -126,7 +127,7 @@ cleanup() {
126127
rm -f $1.aux $1.log $1.out $1.toc $1.bkm $1.idx $1.ilg $1.ind
127128
rm -f mod$1.idx mod$1.ilg mod$1.ind
128129
if [ ! "$BUILD_DVI" ] ; then
129-
rm -f $FILE.dvi
130+
rm -f $1.dvi
130131
fi
131132
}
132133

@@ -213,7 +214,7 @@ if [ "$QUIET" ] ; then
213214
fi
214215

215216
for FILE in $@ ; do
216-
FILE=${FILE%.tex}
217+
FILE=`basename ${FILE%.tex}`
217218
if [ "$BUILD_DVI" -o "$BUILD_PS" ] ; then
218219
build_dvi $FILE 2>&1 | tee -a $LOGFILE
219220
fi

0 commit comments

Comments
 (0)