mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-28 15:01:21 +02:00
obscure crash with hasbrpsfx()
This commit is contained in:
parent
ff9f2bb88e
commit
9986ebfd33
@ -1,3 +1,8 @@
|
||||
2006-10-27 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 22921: Src/compresult.c: obscure crash reveals
|
||||
hasbrpsfx() can be called with line unmetafied.
|
||||
|
||||
2006-10-30 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 22913: Doc/Zsh/params.yo, Src/jobs.c: set $! after a "bg", too.
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user