From: Jim Meyering Date: Sat, 18 May 1996 18:36:10 +0000 (+0000) Subject: (main): Don't recognize --help, --h, --he, --version, --v, etc. X-Git-Tag: TEXTUTILS-1_14e~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d8de9b8ab695a46ff93387b75264611b73e2b49;p=platform%2Fupstream%2Fcoreutils.git (main): Don't recognize --help, --h, --he, --version, --v, etc. if the POSIXLY_CORRECT environment variable is set. (docolon) [RE_SYNTAX_POSIX_BASIC]: Revert my misguided change of Mar 1. --- diff --git a/src/expr.c b/src/expr.c index 6b0324e92..567633b58 100644 --- a/src/expr.c +++ b/src/expr.c @@ -158,7 +158,9 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - parse_long_options (argc, argv, "expr", PACKAGE_VERSION, usage); + /* Don't recognize --help or --version if POSIXLY_CORRECT is set. */ + if (getenv ("POSIXLY_CORRECT") == NULL) + parse_long_options (argc, argv, "expr", PACKAGE_VERSION, usage); if (argc == 1) { @@ -425,7 +427,7 @@ docolon (VALUE *sv, VALUE *pv) re_buffer.allocated = 2 * len; re_buffer.buffer = (unsigned char *) xmalloc (re_buffer.allocated); re_buffer.translate = 0; - re_syntax_options = RE_SYNTAX_POSIX_MINIMAL_BASIC; + re_syntax_options = RE_SYNTAX_POSIX_BASIC; errmsg = re_compile_pattern (pv->u.s, len, &re_buffer); if (errmsg) error (2, 0, "%s", errmsg);