lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / coreutils / tail.c
index 8fc22f562eff7c8b98eb6e3e54591baeb7b697ff..44698f304d38e575e30e9b7a95241387f0be5755 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 /* BB_AUDIT SUSv3 compliant (need fancy for -c) */
@@ -66,7 +66,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
        return r;
 }
 
-static const char header_fmt[] ALIGN1 = "\n==> %s <==\n";
+#define header_fmt_str "\n==> %s <==\n"
 
 static unsigned eat_num(const char *p)
 {
@@ -166,7 +166,7 @@ int tail_main(int argc, char **argv)
        tailbuf = xmalloc(tailbufsize);
 
        /* tail the files */
-       fmt = header_fmt + 1; /* skip header leading newline on first output */
+       fmt = header_fmt_str + 1; /* skip header leading newline on first output */
        i = 0;
        do {
                char *buf;
@@ -181,7 +181,7 @@ int tail_main(int argc, char **argv)
 
                if (nfiles > header_threshhold) {
                        tail_xprint_header(fmt, argv[i]);
-                       fmt = header_fmt;
+                       fmt = header_fmt_str;
                }
 
                if (!from_top) {
@@ -333,7 +333,7 @@ int tail_main(int argc, char **argv)
                        if (ENABLE_FEATURE_FANCY_TAIL && fd < 0)
                                continue;
                        if (nfiles > header_threshhold) {
-                               fmt = header_fmt;
+                               fmt = header_fmt_str;
                        }
                        while ((nread = tail_read(fd, tailbuf, BUFSIZ)) > 0) {
                                if (fmt) {