From 36d228b12934000cf11690b4365c144ef55c905f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 28 Oct 2008 20:55:22 +0000 Subject: 25937: builtins with no options should still ignore -- --- ChangeLog | 7 ++++++- README | 6 ++++++ Src/builtin.c | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 86f1ea3c9..d0e0cc1cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-28 Peter Stephenson + + * 25937: README, Src/builtins.c: builtins that don't have + options now ignore an initial "--" argument. + 2008-10-28 Peter Stephenson * unposted: Config/Version.mk, Etc/relnote_4.3.7.txt: Release @@ -2997,7 +3002,7 @@ 2007-10-23 Peter Stephenson * users/12087: Src/glob.c: fix a case where we doing globbing - unncessarily to find files case-insensitively in Cygwin. + unnecessarily to find files case-insensitively in Cygwin. 2007-10-22 Peter Stephenson diff --git a/README b/README index ce4042b44..ac5f318ff 100644 --- a/README +++ b/README @@ -35,6 +35,12 @@ Possible incompatibilities This section documents incompatibilities in the shell since the 4.2 series of releases. +In previous releases of the shell, builtin commands and precommand +modifiers that did not accept options also did not recognize the +argument "--" as marking the end of option processing without being +considered an argument. This was not documented and was incompatible +with other shells. All such commands now handle this syntax. + The configuration option --enable-lfs to enable large file support has been replaced by autoconf's standard --enable-largefile mechanism. As this is usually used whenever necessary, this won't usually diff --git a/Src/builtin.c b/Src/builtin.c index 003897bb4..837740032 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -391,6 +391,9 @@ execbuiltin(LinkList args, Builtin bn) if (ops.ind['-']) break; } + } else if (*argv && !strcmp(*argv, "--")) { + ops.ind['-'] = 1; + argv++; } /* handle built-in options, for overloaded handler functions */ -- cgit 1.4.1