bug-texinfo
[Top][All Lists]
Advanced

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

texi2dvi: Swap the end of the main loop


From: Akim Demaille
Subject: texi2dvi: Swap the end of the main loop
Date: Tue, 20 Sep 2005 10:33:10 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Bummer!  This one was really really stupid!

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * util/texi2dvi: Be sure to return to the current directory even
        after obeying --clean.

Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.60
diff -u -u -u -r1.60 texi2dvi
--- util/texi2dvi 5 Sep 2005 13:46:15 -0000 1.60
+++ util/texi2dvi 20 Sep 2005 08:32:06 -0000
@@ -1023,18 +1063,20 @@
   # and TeX one last time.
   run_thumbpdf
 
-  # Return to the original directory so that
-  # - the next file is processed in correct conditions
-  # - the temporary file can be removed
-  cd / # in case $orig_pwd is on a different drive (for DOS)
-  cd "$orig_pwd" || exit 1
+  # Both to make sure we can remove $t2ddir (we might have cd'd into
+  # it), and in case $orig_pwd is on a different drive (for DOS).
+  cd /
 
   # Remove temporary files.
   if $clean; then
     verbose "Removing $t2ddir"
-    cd /
     rm -rf "$t2ddir"
   fi
+
+  # Return to the original directory so that
+  # - the next file is processed in correct conditions
+  # - the temporary file can be removed
+  cd "$orig_pwd" || exit 1
 done
 
 verbose "done."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]