zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: BUG: restore_queue_signals(): q = 2 != queue_in = 3
Date: Mon, 30 Jan 2017 07:24:37 -0800	[thread overview]
Message-ID: <170130072437.ZM23342@torch.brasslantern.com> (raw)
In-Reply-To: <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


      reply	other threads:[~2017-01-30 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30  6:53 Daniel Shahaf
2017-01-30 15:24 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170130072437.ZM23342@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).