]> Dogcows Code - chaz/tar/blobdiff - src/buffer.c
Avoid installation glitches on Solaris 8 with Sun C 5.4.
[chaz/tar] / src / buffer.c
index 1b36051e19c784f7e5588162c8f7b06a92ea2f3c..c0cedc3c8e9fa8be2d293268f944d424f2bdb453 100644 (file)
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include <system.h>
+#include <system-ioctl.h>
 
 #include <signal.h>
 
 #include <closeout.h>
 #include <fnmatch.h>
+#include <getline.h>
 #include <human.h>
 #include <quotearg.h>
 
@@ -966,6 +968,7 @@ new_volume (enum access_mode mode)
 {
   static FILE *read_file;
   static int looped;
+  int prompt;
 
   if (!read_file && !info_script_option)
     /* FIXME: if fopen is used, it will never be closed.  */
@@ -989,9 +992,10 @@ new_volume (enum access_mode mode)
       archive_name_cursor = archive_name_array;
       looped = 1;
     }
+  prompt = looped;
 
  tryagain:
-  if (looped)
+  if (prompt)
     {
       /* We have to prompt from now on.  */
 
@@ -1041,6 +1045,7 @@ new_volume (enum access_mode mode)
       open_warn (*archive_name_cursor);
       if (!verify_option && mode == ACCESS_WRITE && backup_option)
        undo_last_backup ();
+      prompt = 1;
       goto tryagain;
     }
 
@@ -1285,10 +1290,10 @@ add_chunk_header ()
 
       block_ordinal = current_block_ordinal ();
       blk = start_header (&st);
-      free (st.orig_file_name);
       if (!blk)
        abort (); /* FIXME */
       finish_header (&st, blk, block_ordinal);
+      free (st.orig_file_name);
     }
 }
 
This page took 0.020817 seconds and 4 git commands to generate.