mirror of
https://github.com/zsh-users/zsh
synced 2024-09-20 08:22:05 +00:00
11057: getopts bug
This commit is contained in:
parent
2c7f678ff0
commit
304d5f9b39
|
@ -1,3 +1,8 @@
|
|||
2000-05-02 Peter Stephenson <pws@cambridgesiliconradio.com>
|
||||
|
||||
* 11057: Src/builtin.c: getopts for options with arguments
|
||||
miscounted $OPTIND and index into subsequent options (see 9095).
|
||||
|
||||
2000-05-02 Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
|
||||
|
||||
* 11053: Completion/Commands/_complete_help: always use empty
|
||||
|
|
|
@ -3077,7 +3077,15 @@ err:
|
|||
p = ztrdup(args[zoptind++]);
|
||||
} else
|
||||
p = metafy(str+optcind, lenstr-optcind, META_DUP);
|
||||
optcind = ztrlen(args[zoptind - 1]);
|
||||
/*
|
||||
* Careful: I've just changed the following two lines from
|
||||
* optcind = ztrlen(args[zoptind - 1]);
|
||||
* and it's a rigorous theorem that every change in getopts breaks
|
||||
* something. See zsh-workers/9095 for the bug fixed here.
|
||||
* PWS 2000/05/02
|
||||
*/
|
||||
optcind = 0;
|
||||
zoptind++;
|
||||
zsfree(zoptarg);
|
||||
zoptarg = p;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue