Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Improve error handling and fix a problem for parse_cmatcher()
- X-seq: zsh-workers 35665
- From: Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Improve error handling and fix a problem for parse_cmatcher()
- Date: Wed, 1 Jul 2015 16:34:40 +0800
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
The first two modifications are for improving error handling. The third is for
fixing the bug when 'both' is set to 1 previously.
---
Src/Zle/complete.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index ea5e41f..850766c 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -268,7 +268,10 @@ parse_cmatcher(char *name, char *s)
if (!*s || !*++s) {
if (name)
- zwarnnam(name, "missing line pattern");
+ if (both)
+ zwarnnam(name, "missing right anchor");
+ else
+ zwarnnam(name, "missing line pattern");
return pcm_err;
}
} else
@@ -288,6 +291,7 @@ parse_cmatcher(char *name, char *s)
if ((fl & CMF_RIGHT) && !fl2 && (!*s || !*++s)) {
if (name)
zwarnnam(name, "missing right anchor");
+ return pcm_err;
} else if (!(fl & CMF_RIGHT) || fl2) {
if (!*s) {
if (name)
@@ -313,8 +317,7 @@ parse_cmatcher(char *name, char *s)
return pcm_err;
}
s++;
- } else
- right = NULL;
+ }
if (*s == '*') {
if (!(fl & (CMF_LEFT | CMF_RIGHT))) {
--
1.9.3
Messages sorted by:
Reverse Date,
Date,
Thread,
Author