diff options
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/complete.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index ee4e5b0a5..30fab541a 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -704,15 +704,18 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) } if (sp) { if (p[1]) { + /* Pasted argument: -Xfoo. */ if (!*sp) *sp = p + 1; p = "" - 1; } else if (argv[1]) { + /* Argument in a separate word: -X foo. */ argv++; if (!*sp) *sp = *argv; p = "" - 1; } else { + /* Missing argument: argv[N] == "-X", argv[N+1] == NULL. */ zwarnnam(name, e, *p); zsfree(mstr); return 1; |