[git commit master] tailk: fix error detected by testsuite

Denys Vlasenko vda.linux at googlemail.com
Fri Mar 12 21:16:25 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=6eaeb7737d95661ca31b162977ac443ffeb7b0b3
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/tail.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/coreutils/tail.c b/coreutils/tail.c
index 83768d4..8fc22f5 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -241,7 +241,8 @@ int tail_main(int argc, char **argv)
 						} while (nwrite);
 					}
 				}
-				xwrite(STDOUT_FILENO, buf + nread - nwrite, nwrite);
+				if (nwrite > 0)
+					xwrite(STDOUT_FILENO, buf + nread - nwrite, nwrite);
 			} else if (count) {
 				if (COUNT_BYTES) {
 					taillen += nread;
-- 
1.6.3.3



More information about the busybox-cvs mailing list