1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-28 19:39:52 +02:00

(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.
This commit is contained in:
Jim Meyering
1996-05-31 03:35:32 +00:00
parent 7b297f76c4
commit 20522f2f5d
+7 -1
View File
@@ -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)
{