mirror of
https://git.busybox.net/busybox
synced 2026-01-31 16:43:21 +00:00
A patch from Erik Meusel <erik@wh58-709.st.uni-magdeburg.de>
to fix the behavior of 'tail -f -n 0 FILE'
This commit is contained in:
parent
78b0e379d7
commit
ce98c19dfe
2 changed files with 8 additions and 0 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
4
tail.c
4
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]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue