summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-01-22 04:53:52 +0000
committerJim Meyering <jim@meyering.net>1997-01-22 04:53:52 +0000
commitf3f1cae09725187c7730f0c45ddb720715c84aaa (patch)
treef420000d9bdb5d996171a44b789567f9ae6e38fc /src
parentfbe50426e2da59f4377e55cb312433321486ccfb (diff)
downloadcoreutils-f3f1cae09725187c7730f0c45ddb720715c84aaa.tar.xz
(main): Properly handle what the POSIX spec calls
the `obsolescent' usage (e.g., tail +2c). It didn't work. Reported by Karl Heuer.
Diffstat (limited to 'src')
-rw-r--r--src/tail.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/tail.c b/src/tail.c
index bc82f100f..d79435f4b 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -874,15 +874,15 @@ main (int argc, char **argv)
strtol_error s_err;
char *p;
- s_err = xstrtol (++argv[1], &p, 0, &tmp_long, "bkm");
+ s_err = xstrtol (++argv[1], &p, 0, &tmp_long, "cbkm");
n_units = tmp_long;
if (s_err == LONGINT_OVERFLOW)
{
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')
+ /* If a [bckm] suffix was given then count bytes, not lines. */
+ if (p[-1] == 'b' || p[-1] == 'c' || p[-1] == 'k' || p[-1] == 'm')
count_lines = 0;
/* Parse any appended option letters. */
@@ -890,11 +890,6 @@ main (int argc, char **argv)
{
switch (*p)
{
- case 'c':
- /* Interpret N_UNITS as # of bytes. */
- count_lines = 0;
- break;
-
case 'f':
forever = 1;
break;