From 91b9f3d7866c8c27c693d65ae1f42609227b907b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 3 Oct 2007 16:18:38 +0000 Subject: 23900: Better handling of NO_EQUALS in old completion --- Src/Zle/compctl.c | 2 +- Src/Zle/zle_tricky.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'Src/Zle') diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c index 143c93682..57bfccd49 100644 --- a/Src/Zle/compctl.c +++ b/Src/Zle/compctl.c @@ -3501,7 +3501,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) p++; /* Get the pattern string. */ tokenize(g = dupstrpfx(g, p - g)); - if (*g == '=') + if (*g == '=' && isset(EQUALS)) *g = Equals; if (*g == '~') *g = Tilde; diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index b3b1dfd3e..09e4ae8e1 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -1608,6 +1608,13 @@ get_comp_string(void) *q = Bnull; } } + /* + * Leading "=" gets tokenized in case the EQUALS options + * changes afterwards. It's too late for that now, so restore it + * to a plain "=" if the option is unset. + */ + if (*s == Equals && !isset(EQUALS)) + *s = '='; /* While building the quoted form, we also clean up the command line. */ for (p = s, i = wb, j = 0; *p; p++, i++) { int skipchars; -- cgit 1.4.1