From a5ea39b402ebdc39621ce44fdbe6bd0d06a3f5b1 Mon Sep 17 00:00:00 2001
From: andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Date: Tue, 26 Jun 2001 15:07:08 +0000
Subject: A patch from Erik Meusel <erik@wh58-709.st.uni-magdeburg.de> to fix
 the behavior of 'tail -f -n 0 FILE'

git-svn-id: svn://busybox.net/trunk/busybox@2909 69ca8d6d-28ef-0310-b511-8ec308f3f277
---
 coreutils/tail.c | 4 ++++
 tail.c           | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/coreutils/tail.c b/coreutils/tail.c
index 4fe92ba5e..90cc2a6ef 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -127,6 +127,10 @@ int tail_main(int argc, char **argv)
 	for (i = 0; i < nfiles; i++) {
 		if (fds[i] == -1)
 			continue;
+		if (!count) {
+			lseek(fds[i], 0, SEEK_END);
+			continue;
+		}
 		seen = 0;
 		if (show_headers || (!hide_headers && nfiles > 1))
 			printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]);
diff --git a/tail.c b/tail.c
index 4fe92ba5e..90cc2a6ef 100644
--- a/tail.c
+++ b/tail.c
@@ -127,6 +127,10 @@ int tail_main(int argc, char **argv)
 	for (i = 0; i < nfiles; i++) {
 		if (fds[i] == -1)
 			continue;
+		if (!count) {
+			lseek(fds[i], 0, SEEK_END);
+			continue;
+		}
 		seen = 0;
 		if (show_headers || (!hide_headers && nfiles > 1))
 			printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]);
-- 
cgit v1.2.3-55-g6feb