1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-22 16:20:23 +02:00

36911: '-optarg' should not match optspec '-opt='

Remove the requirement that -xy= should come before -x= in the
list of optspecs passed to _arguments.
This commit is contained in:
Jun-ichi Takimoto 2015-10-25 23:42:03 +09:00
parent 2685bbc4ae
commit a40417929c
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2015-10-25 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 36911: Src/Zle/computil.c: '-optarg' should not match
optspec '-opt='
2015-10-24 Barton E. Schaefer <schaefer@zsh.org>
* 36943 (with updated comment): Src/mem.c: restore scan for

View file

@ -1693,10 +1693,13 @@ ca_get_opt(Cadef d, char *line, int full, char **end)
for (p = d->opts; p; p = p->next)
if (p->active && ((!p->args || p->type == CAO_NEXT) ?
!strcmp(p->name, line) : strpfx(p->name, line))) {
int l = strlen(p->name);
if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
line[l] && line[l] != '=')
continue;
if (end) {
/* Return a pointer to the end of the option. */
int l = strlen(p->name);
if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
line[l] == '=')
l++;