summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-01-16 22:53:00 +0000
committerJim Meyering <jim@meyering.net>2002-01-16 22:53:00 +0000
commit65562d99c309da8cc885b605f6cef5cde74547fe (patch)
treeb03cc414af7d66507c98970910dd049c7f235bd3 /src
parentf199c753eb7c332b1e00840ebfa631ef508c763f (diff)
downloadcoreutils-65562d99c309da8cc885b605f6cef5cde74547fe.tar.xz
Add support for POSIX 1003.1-2001, which requires removal for
support of obsolete "+" option syntax in sort, tail, and uniq. (usage, parse_obsolescent_option): Implement the above.
Diffstat (limited to 'src')
-rw-r--r--src/tail.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/tail.c b/src/tail.c
index da757ad15..668dbe64d 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -289,13 +289,13 @@ b for 512, k for 1024, m for 1048576 (1 Meg). \
"), stdout);
fputs (_("\
A first OPTION of -VALUE\n\
-or +VALUE is treated like -n VALUE or -n +VALUE unless VALUE has one of\n\
-the [bkm] suffix multipliers, in which case it is treated like -c VALUE\n\
-or -c +VALUE. \
+is treated like -n VALUE unless VALUE has one of the [bkm] suffix\n\
+multipliers, in which case it is treated like -c VALUE.\n\
"), stdout);
- fputs (_("\
-Warning: a first option of +VALUE is obsolescent, and support\n\
-for it will be withdrawn.\n\
+ if (POSIX2_VERSION < 200112)
+ fputs (_("\
+A first option of +VALUE is treated like -+VALUE, but this usage is obsolete\n\
+and support for it will be withdrawn.\n\
\n\
"), stdout);
fputs (_("\
@@ -1285,9 +1285,11 @@ parse_obsolescent_option (int argc, const char *const *argv,
if (argc < 2)
return 0;
- /* If P starts with `+', `-N' (where N is a digit), or `-l',
+ /* If P starts with `+' and the POSIX version predates 1003.1-2001,
+ or P starts with `-N' (where N is a digit) or `-l',
then it is obsolescent. Return zero otherwise. */
- if ( ! (p[0] == '+' || (p[0] == '-' && (p[1] == 'l' || ISDIGIT (p[1])))) )
+ if (! ((POSIX2_VERSION < 200112 && p[0] == '+')
+ || (p[0] == '-' && (p[1] == 'l' || ISDIGIT (p[1])))))
return 0;
if (*p == '+')