From 9986ebfd3334ac58f81259d2ec276379c4c020ec Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 30 Oct 2006 12:57:52 +0000 Subject: obscure crash with hasbrpsfx() --- Src/Zle/compresult.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Src/Zle') diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c index 2dabe2c35..43dce9276 100644 --- a/Src/Zle/compresult.c +++ b/Src/Zle/compresult.c @@ -683,11 +683,19 @@ instmatch(Cmatch m, int *scs) mod_export int hasbrpsfx(Cmatch m, char *pre, char *suf) { - METACHECK(); + int was_meta; if (m->flags & CMF_ALL) return 1; - else { + + /* May not be metafied if calculating whether to show a list. */ + if (zlemetaline == NULL) { + was_meta = 0; + metafy_line(); + } else + was_meta = 1; + + { char *op = lastprebr, *os = lastpostbr; VARARR(char, oline, zlemetall); int oll = zlemetall, ocs = zlemetacs, ole = lastend, opcs = brpcs, oscs = brscs, ret; @@ -717,6 +725,8 @@ hasbrpsfx(Cmatch m, char *pre, char *suf) lastprebr = op; lastpostbr = os; + if (!was_meta) + unmetafy_line(); return ret; } } -- cgit 1.4.1