summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-02-01 16:31:55 +0000
committerJim Meyering <jim@meyering.net>2002-02-01 16:31:55 +0000
commit3e04fcdbb5cdfec6d649b5fa6bf16344cff68d84 (patch)
treeeecca540507f3f771abfe460b0085c7dcc3390f6
parent31cb36e88f2ab50493d3badd12c021746d2b4e2c (diff)
downloadcoreutils-3e04fcdbb5cdfec6d649b5fa6bf16344cff68d84.tar.xz
Add more support for POSIX 1003.1-2001, which requires removal for
support of obsolete "-N" option syntax in expand, head, fold, split, tail, unexpand, uniq, and which prohibits options with optional arguments in od and pr. (parse_obsolescent_option, main): Likewise.
-rw-r--r--src/tail.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/tail.c b/src/tail.c
index f94a075cf..0caf6fb7d 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1299,11 +1299,9 @@ parse_obsolescent_option (int argc, const char *const *argv,
if (argc < 2)
return 0;
- /* If P starts with `+' and the POSIX version predates 1003.1-2001,
- or P starts with `-N' (where N is a digit) or `-l',
+ /* If P starts with `+', `-N' (where N is a digit), or `-l',
then it is obsolescent. Return zero otherwise. */
- if (! ((POSIX2_VERSION < 200112 && p[0] == '+')
- || (p[0] == '-' && (p[1] == 'l' || ISDIGIT (p[1])))))
+ if (! (p[0] == '+' || (p[0] == '-' && (p[1] == 'l' || ISDIGIT (p[1])))))
return 0;
if (*p == '+')
@@ -1419,7 +1417,7 @@ option instead."), argv[1]);
#endif
}
- if (! posix_pedantic)
+ if (OBSOLETE_OPTION_WARNINGS && ! posix_pedantic)
error (0, 0,
_("warning: `tail %s' is obsolete; use -n or -c instead"),
argv[1]);
@@ -1606,12 +1604,12 @@ main (int argc, char **argv)
have_read_stdin = 0;
{
- int found_obsolescent;
int fail;
- found_obsolescent = parse_obsolescent_option (argc,
- (const char *const *) argv,
- &n_units, &fail);
- if (found_obsolescent)
+
+ if (POSIX2_VERSION < 200112
+ && parse_obsolescent_option (argc,
+ (const char *const *) argv,
+ &n_units, &fail))
{
if (fail)
exit (EXIT_FAILURE);