mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 16:50:58 +01:00
11057: getopts bug
This commit is contained in:
parent
2c7f678ff0
commit
304d5f9b39
2 changed files with 14 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue