Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: BUG: restore_queue_signals(): q = 2 != queue_in = 3
- X-seq: zsh-workers 40469
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: BUG: restore_queue_signals(): q = 2 != queue_in = 3
- Date: Mon, 30 Jan 2017 07:24:37 -0800
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=17C2SYJ7WwozBa/KL90sSbtv2eGf95y/T+jLxWcg5OY=; b=PO74QRxWe2w6el85eRapfjmNHEalT6hTuDfum2oy5jzvJdujfot0oJMdivmgN+C3BD OXBUHInPkpY8+rn8cnuvbRefrpsnwg1m3X26W5PdL87k4/XEu/J5roUlo4ylDUEKgYcQ xx9ANVBbHP3xIA7fyomus+csOHObeTiHPZVXhzYApKNbZOPQzvhvGkgnXG0SfmqsLBLo qDlczwAhyQ+F7qbQFzjySGn99Tf43WGGI7nxxZ6Cek8JPZyMI/TuHgFLFNI3KEl7oiHG XZ4EV23sC/1pNRYuzTYTJtekTqdoE7jDcEjLrHmjwTlm4ujT1fwilgOB1VxhMGKflonD mZKA==
- In-reply-to: <20170130065325.GA6220@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20170130065325.GA6220@fujitsu.shahaf.local2>
OK, this is one of those cases where I had to choose between HEAPDUP and
queue_signals() and I missed some "return" in the blocks. There aren't
other globals being manipulated here so rather than try to catch all the
early "return" let's just drop use of PAT_STATIC.
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 49b338f..68bdf23 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -896,14 +896,12 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
int i, l = arrlen(compwords), t = 0, b = 0, e = l - 1;
Patprog pp;
- queue_signals(); /* Protect PAT_STATIC */
-
i = compcurrent - 1;
if (i < 0 || i >= l)
return 0;
singsub(&sa);
- pp = patcompile(sa, PAT_STATIC, NULL);
+ pp = patcompile(sa, PAT_HEAPDUP, NULL);
for (i--, p = compwords + i; i >= 0; p--, i--) {
if (pattry(pp, *p)) {
@@ -932,9 +930,6 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
t = 0;
if (t && mod)
restrict_range(b, e);
-
- unqueue_signals();
-
return t;
}
case CVT_PRENUM:
@@ -957,12 +952,10 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
{
Patprog pp;
- queue_signals(); /* Protect PAT_STATIC */
-
if (!na)
return 0;
- if (!(pp = patcompile(sa, PAT_STATIC, 0)))
+ if (!(pp = patcompile(sa, PAT_HEAPDUP, 0)))
return 0;
if (test == CVT_PREPAT) {
@@ -1043,9 +1036,6 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
if (mod)
ignore_suffix(ol - (p - compsuffix));
}
-
- unqueue_signals();
-
return 1;
}
}
--
Barton E. Schaefer
Messages sorted by:
Reverse Date,
Date,
Thread,
Author