summaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-08-24 07:56:46 +0000
committerJim Meyering <jim@meyering.net>2001-08-24 07:56:46 +0000
commit4bc8b66e3a71d99dfadc202697b85e80a6742428 (patch)
tree2f3299d25bfd8185558f088d3db6f97a404eb587 /src/expr.c
parente0f3ba1a46eba6c250756d79eeedd72d57a0c02e (diff)
downloadcoreutils-4bc8b66e3a71d99dfadc202697b85e80a6742428.tar.xz
(posixly_correct): Remove; no longer needed.
(main): Do not worry about POSIXLY_CORRECT, as it's OK for expr to have options (so long as they do not begin with digits).
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/expr.c b/src/expr.c
index db2978386..ad9b257ca 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -68,10 +68,6 @@ struct valinfo
};
typedef struct valinfo VALUE;
-/* Non-zero if the POSIXLY_CORRECT environment variable is set.
- The unary operator `quote' is disabled when this variable is zero. */
-static int posixly_correct;
-
/* The arguments given to the program, minus the program name. */
static char **args;
@@ -130,7 +126,7 @@ separates increasing precedence groups. EXPRESSION may be:\n\
substr STRING POS LENGTH substring of STRING, POS counted from 1\n\
index STRING CHARS index in STRING where any CHARS is found, or 0\n\
length STRING length of STRING\n\
- quote TOKEN interpret TOKEN as a string, even if it is a\n\
+ + TOKEN interpret TOKEN as a string, even if it is a\n\
keyword like `match' or an operator like `/'\n\
\n\
( EXPRESSION ) value of EXPRESSION\n\
@@ -159,12 +155,8 @@ main (int argc, char **argv)
atexit (close_stdout);
- posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL);
-
- /* Recognize --help or --version only if POSIXLY_CORRECT is not set. */
- if (!posixly_correct)
- parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
- AUTHORS, usage);
+ parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
+ AUTHORS, usage);
/* The above handles --help and --version.
Since there is no other invocation of getopt, handle `--' here. */
if (argc > 1 && STREQ (argv[1], "--"))
@@ -470,7 +462,7 @@ eval7 (void)
return str_value (*args++);
}
-/* Handle match, substr, index, length, and quote keywords. */
+/* Handle match, substr, index, and length keywords, and quoting "+". */
static VALUE *
eval6 (void)
@@ -484,7 +476,7 @@ eval6 (void)
#ifdef EVAL_TRACE
trace ("eval6");
#endif
- if (!posixly_correct && nextarg ("quote"))
+ if (nextarg ("+"))
{
if (nomoreargs ())
error (2, 0, _("syntax error"));