From: Jim Meyering Date: Fri, 31 May 1996 03:35:32 +0000 (+0000) Subject: (main): Interpret the old-style +VALUE and -VALUE X-Git-Tag: TEXTUTILS-1_16~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20522f2f5d05091ba199f332752f00ad9927abbe;p=thirdparty%2Fcoreutils.git (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. --- diff --git a/src/tail.c b/src/tail.c index 9f899d33ce..fe631f9faf 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) {