summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-05-31 03:35:32 +0000
committerJim Meyering <jim@meyering.net>1996-05-31 03:35:32 +0000
commit20522f2f5d05091ba199f332752f00ad9927abbe (patch)
tree476c932fe1629875b0a6d831ebeae9bf851d62a0 /src/tail.c
parent7b297f76c48fe0c37e63ed0c95aad26c04320262 (diff)
downloadcoreutils-20522f2f5d05091ba199f332752f00ad9927abbe.tar.xz
(main): Interpret the old-style +VALUE and -VALUE
options like -c VALUE and -c +VALUE (resp) when VALUE has one of the [bkm] suffix multipliers. This makes the code consistent with --help output.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tail.c b/src/tail.c
index 9f899d33c..fe631f9fa 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -861,7 +861,8 @@ main (int argc, char **argv)
if (argc > 1
&& ((argv[1][0] == '-' && ISDIGIT (argv[1][1]))
- || (argv[1][0] == '+' && (ISDIGIT (argv[1][1]) || argv[1][1] == 0))))
+ || (argv[1][0] == '+' && (ISDIGIT (argv[1][1])
+ || argv[1][1] == 0))))
{
/* Old option syntax: a dash or plus, one or more digits (zero digits
are acceptable with a plus), and one or more option letters. */
@@ -878,6 +879,11 @@ main (int argc, char **argv)
{
STRTOL_FATAL_ERROR (argv[1], _("argument"), s_err);
}
+
+ /* If a [bkm] suffix was given then count bytes, not lines. */
+ if (p[-1] == 'b' || p[-1] == 'k' || p[-1] == 'm')
+ count_lines = 0;
+
/* Parse any appended option letters. */
while (*p)
{