From d7582f006f950be2622bc0d5ff26aaaa20af3b7f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 4 Jun 2011 21:32:06 +0000 Subject: 29459: Further fixes for parameter flag completion, plus drive-by fix for double-quoted parameter completion with flags --- Src/Zle/compcore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 704e125bc..0a1a97c3d 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -1099,7 +1099,7 @@ mod_export char * check_param(char *s, int set, int test) { char *p; - int found = 0; + int found = 0, qstring = 0; zsfree(parpre); parpre = NULL; @@ -1126,6 +1126,7 @@ check_param(char *s, int set, int test) !(*p == String && p[1] == Snull) && !(*p == Qstring && p[1] == '\'')) { found = 1; + qstring = (*p == Qstring); break; } } @@ -1161,7 +1162,8 @@ check_param(char *s, int set, int test) /* Ignore the possible (...) flags. */ b++, br++; - if (skipparens(Inpar, Outpar, &b) > 0) { + if ((qstring ? skipparens('(', ')', &b) : + skipparens(Inpar, Outpar, &b)) > 0) { /* * We are still within the parameter flags. There's no * point trying to do anything clever here with -- cgit 1.4.1