summaryrefslogtreecommitdiff
path: root/coreutils/tail.c
diff options
context:
space:
mode:
authorEric Andersen2001-05-21 20:30:51 +0000
committerEric Andersen2001-05-21 20:30:51 +0000
commit004015e9c4e8ff98bcbaf955cf42147218204da4 (patch)
treeb6f1eb9281b70d0723d82a68ed090e619dbbf606 /coreutils/tail.c
parentabec344ab7060d940f133d93b76e6bbe5881e205 (diff)
downloadbusybox-004015e9c4e8ff98bcbaf955cf42147218204da4.zip
busybox-004015e9c4e8ff98bcbaf955cf42147218204da4.tar.gz
Patch from Lars Kellogg-Stedman <lars@larsshack.org> to fix bug
#1130 (i.e. When you turn on features it should always ADD features)
Diffstat (limited to 'coreutils/tail.c')
-rw-r--r--coreutils/tail.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c
index ff77bde..4fe92ba 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -73,7 +73,7 @@ int tail_main(int argc, char **argv)
case 'f':
follow = 1;
break;
-#ifndef BB_FEATURE_SIMPLE_TAIL
+#ifdef BB_FEATURE_FANCY_TAIL
case 'c':
units = BYTES;
/* FALLS THROUGH */
@@ -85,7 +85,7 @@ int tail_main(int argc, char **argv)
if (optarg[0] == '+')
from_top = 1;
break;
-#ifndef BB_FEATURE_SIMPLE_TAIL
+#ifdef BB_FEATURE_FANCY_TAIL
case 'q':
hide_headers = 1;
break;
@@ -118,7 +118,7 @@ int tail_main(int argc, char **argv)
}
}
-#ifndef BB_FEATURE_SIMPLE_TAIL
+#ifdef BB_FEATURE_FANCY_TAIL
/* tail the files */
if (!from_top && units == BYTES)
tailbuf = xmalloc(count);
@@ -132,7 +132,7 @@ int tail_main(int argc, char **argv)
printf("%s==> %s <==\n", i == 0 ? "" : "\n", argv[optind + i]);
while ((nread = safe_read(fds[i], buf, sizeof(buf))) > 0) {
if (from_top) {
-#ifndef BB_FEATURE_SIMPLE_TAIL
+#ifdef BB_FEATURE_FANCY_TAIL
if (units == BYTES) {
if (count - 1 <= seen)
nwrite = nread;
@@ -165,7 +165,7 @@ int tail_main(int argc, char **argv)
break;
}
} else {
-#ifndef BB_FEATURE_SIMPLE_TAIL
+#ifdef BB_FEATURE_FANCY_TAIL
if (units == BYTES) {
if (nread < count) {
memmove(tailbuf, tailbuf + nread, count - nread);
@@ -199,7 +199,7 @@ int tail_main(int argc, char **argv)
status = EXIT_FAILURE;
}
-#ifndef BB_FEATURE_SIMPLE_TAIL
+#ifdef BB_FEATURE_FANCY_TAIL
if (!from_top && units == BYTES) {
if (count < seen)
seen = count;