From 51503a87a20d766bbf7b1228716a863f3564512d Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Wed, 27 Jun 2001 13:18:38 +0000 Subject: (only the patch to compmatch.c from the mail); improve merging cline lists coming from different IPREFIX/PREFIX combinations and such by avoiding to generate cline structs for empty parts after a match spec anchor cline struct (15123) --- Src/Zle/compmatch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Src/Zle/compmatch.c') diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index 8e8a7ae7f..974f2ab3c 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -1178,14 +1178,18 @@ bld_parts(char *str, int len, int plen, Cline *lp) } /* This is the cline struct for the remaining string at the end. */ - *q = n = get_cline(NULL, 0, NULL, 0, NULL, 0, (plen <= 0 ? CLF_NEW : 0)); if (p != str) { int olen = str - p, llen = (op < 0 ? 0 : op); + *q = n = get_cline(NULL, 0, NULL, 0, NULL, 0, (plen <= 0 ? CLF_NEW : 0)); + if (llen > olen) llen = olen; n->prefix = get_cline(NULL, llen, p, olen, NULL, 0, 0); } + else if (!ret) + *q = n = get_cline(NULL, 0, NULL, 0, NULL, 0, (plen <= 0 ? CLF_NEW : 0)); + n->next = NULL; if (lp) -- cgit 1.4.1