X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fbuffer.c;h=e531061d7036ee48e35f674d15fb9e8fdbf69c06;hb=eb5c8f4b8b84e341eec47833ccc9401b9293a0cf;hp=73e434499f4f65eba9aace9788e7a6b4e3c4eb6e;hpb=29c1020f91a08bd9919180755247fef2cffe5d53;p=chaz%2Ftar diff --git a/src/buffer.c b/src/buffer.c index 73e4344..e531061 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1,5 +1,8 @@ /* Buffer management for tar. - Copyright 1988, 92, 93, 94, 96, 97, 99, 2000 Free Software Foundation, Inc. + + Copyright 1988, 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001 Free + Software Foundation, Inc. + Written by John Gilmore, on 1985-08-25. This program is free software; you can redistribute it and/or modify it @@ -19,10 +22,6 @@ #include "system.h" #include -#include -#ifndef time -time_t time (); -#endif #if MSDOS # include @@ -584,17 +583,8 @@ child_open_for_uncompress (void) while (maximum) { count = maximum < BLOCKSIZE ? maximum : BLOCKSIZE; - status = full_write (STDOUT_FILENO, cursor, count); - if (status < 0) + if (full_write (STDOUT_FILENO, cursor, count) != count) write_error (use_compress_program_option); - - if (status != count) - { - ERROR ((0, 0, _("Write to compression program short %lu bytes"), - (unsigned long) (count - status))); - count = status; - } - cursor += count; maximum -= count; } @@ -896,7 +886,7 @@ flush_write (void) } cursor = save_name + FILESYSTEM_PREFIX_LEN (save_name); - while (*cursor == '/') + while (ISSLASH (*cursor)) cursor++; assign_string (&real_s_name, cursor); @@ -993,7 +983,7 @@ flush_write (void) { char *cursor = save_name + FILESYSTEM_PREFIX_LEN (save_name); - while (*cursor == '/') + while (ISSLASH (*cursor)) cursor++; assign_string (&real_s_name, cursor); @@ -1070,7 +1060,7 @@ flush_read (void) { char *cursor = save_name + FILESYSTEM_PREFIX_LEN (save_name); - while (*cursor == '/') + while (ISSLASH (*cursor)) cursor++; assign_string (&real_s_name, cursor); @@ -1198,7 +1188,8 @@ flush_read (void) more = record_start->buffer + status; left = record_size - status; - while (left % BLOCKSIZE != 0) + while (left % BLOCKSIZE != 0 + || (left && status && read_full_records_option)) { if (status) while ((status = rmtread (archive, more, left)) < 0) @@ -1206,8 +1197,9 @@ flush_read (void) if (status == 0) { - ERROR ((0, 0, _("%d garbage bytes ignored at end of archive"), - (int) ((record_size - left) % BLOCKSIZE))); + if (left % BLOCKSIZE != 0) + ERROR ((0, 0, _("%d garbage bytes ignored at end of archive"), + (int) ((record_size - left) % BLOCKSIZE))); break; } @@ -1453,7 +1445,8 @@ new_volume (enum access_mode access) { if (volno_file_option) closeout_volume_number (); - system (info_script_option); + if (system (info_script_option) != 0) + FATAL_ERROR ((0, 0, _("`%s' command failed"), info_script_option)); } else while (1)