Fix /bin/sh's broken handling of the builtin getopts(1). The options
``-ffoo'' and ``-f foo'' have been treated differently. This has been in violation of Posix.2 (that deprecates -ffoo, but doesn't disallow it).
This commit is contained in:
parent
78f1a844fb
commit
78e1fb6090
@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: options.c,v 1.2 1994/09/24 02:58:04 davidg Exp $
|
||||
* $Id: options.c,v 1.3 1995/05/30 00:07:21 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -374,12 +374,11 @@ getoptscmd(argc, argv) char **argv; {
|
||||
q++;
|
||||
}
|
||||
if (*++q == ':') {
|
||||
if (*p == '\0' && (p = *shellparam.optnext) == NULL) {
|
||||
if (*p == '\0' && (p = *shellparam.optnext++) == NULL) {
|
||||
out1fmt("No arg for -%c option\n", c);
|
||||
c = '?';
|
||||
goto out;
|
||||
}
|
||||
shellparam.optnext++;
|
||||
setvar("OPTARG", p, 0);
|
||||
p = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user