From: Glenn L McGrath Date: Mon, 24 Nov 2003 23:50:07 +0000 (-0000) Subject: When a size of 0 is passed to copyfd_size, dont do anything, it was X-Git-Tag: 1_00_pre4~23 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c3498f678aaae3dc30b1976af498f9e1b0309b5b;p=oweals%2Fbusybox.git When a size of 0 is passed to copyfd_size, dont do anything, it was reading untill eof which breaks tar --- diff --git a/libbb/copyfd.c b/libbb/copyfd.c index 62ada8e02..1ef994c98 100644 --- a/libbb/copyfd.c +++ b/libbb/copyfd.c @@ -78,7 +78,10 @@ extern size_t bb_full_fd_action(int src_fd, int dst_fd, const size_t size, ssize extern int bb_copyfd_size(int fd1, int fd2, const off_t size) { - return(bb_full_fd_action(fd1, fd2, size, bb_full_write)); + if (size) { + return(bb_full_fd_action(fd1, fd2, size, bb_full_write)); + } + return(0); } extern int bb_copyfd_eof(int fd1, int fd2)