svn commit: r188343 - head/usr.bin/tar

Tim Kientzle kientzle at FreeBSD.org
Sun Feb 8 14:02:47 PST 2009


Author: kientzle
Date: Sun Feb  8 22:02:46 2009
New Revision: 188343
URL: http://svn.freebsd.org/changeset/base/188343

Log:
  When copying file data to the archive, don't write more
  than was read.  This seems to have only affected the shar
  writer, since other formats proactively truncate output
  to the originally-advertised size.
  
  PR:		bin/131244
  MFC after:	7 days

Modified:
  head/usr.bin/tar/write.c

Modified: head/usr.bin/tar/write.c
==============================================================================
--- head/usr.bin/tar/write.c	Sun Feb  8 22:01:20 2009	(r188342)
+++ head/usr.bin/tar/write.c	Sun Feb  8 22:02:46 2009	(r188343)
@@ -972,7 +972,7 @@ write_file_data(struct bsdtar *bsdtar, s
 		siginfo_printinfo(bsdtar, progress);
 
 		bytes_written = archive_write_data(a, bsdtar->buff,
-		    FILEDATABUFLEN);
+		    bytes_read);
 		if (bytes_written < 0) {
 			/* Write failed; this is bad */
 			bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));


More information about the svn-src-head mailing list