summaryrefslogtreecommitdiff
path: root/Src/Zle/compmatch.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-01-29 11:08:04 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-01-29 11:08:04 +0000
commite92801a2c037cca76994f399a6f240e1ec6722d3 (patch)
tree96cefbaf3f2aea07a271b85c114f2a4ed6782bcf /Src/Zle/compmatch.c
parentaf39a5ab1a4f0b154ac212fdeb86bad322b32056 (diff)
downloadzsh-e92801a2c037cca76994f399a6f240e1ec6722d3.tar.gz
zsh-e92801a2c037cca76994f399a6f240e1ec6722d3.zip
26466: suffix in certain matcher modes mishandled pattern
Diffstat (limited to 'Src/Zle/compmatch.c')
-rw-r--r--Src/Zle/compmatch.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index c4523ae47..b59f5a2e1 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -1818,10 +1818,12 @@ bld_line(Cmatcher mp, ZLE_STRING_T line, char *mword, char *word,
if (sfx) {
wp = wordcp - 1;
- curgenpat--;
- } else
+ tmpgenpat = curgenpat - 1;
+ } else {
+ tmpgenpat = curgenpat;
wp = wordcp;
- if (pattern_match1(curgenpat, *wp, &wmtp))
+ }
+ if (pattern_match1(tmpgenpat, *wp, &wmtp))
{
convchar_t lchr;
/*
@@ -1831,8 +1833,8 @@ bld_line(Cmatcher mp, ZLE_STRING_T line, char *mword, char *word,
* else if it's generic, keep the word character,
* since we have no choice.
*/
- if (curgenpat->tp == CPAT_CHAR)
- lchr = curgenpat->u.chr;
+ if (tmpgenpat->tp == CPAT_CHAR)
+ lchr = tmpgenpat->u.chr;
else
lchr = *wp;
@@ -1845,9 +1847,10 @@ bld_line(Cmatcher mp, ZLE_STRING_T line, char *mword, char *word,
wlen--;
rl++;
- if (sfx)
+ if (sfx) {
wordcp = wp;
- else {
+ curgenpat = tmpgenpat;
+ } else {
if (llen)
curgenpat++;
wordcp++;