From 8672d19f0c0f25569e233bbd466b6c39f60c7a55 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 20 Mar 2014 07:56:30 -0700 Subject: 32500: handle interrupts during pattern matching --- ChangeLog | 2 ++ Src/pattern.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 34600cc31..827d6eef2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ 2014-03-18 Barton E. Schaefer + * 32500: Src/pattern.c: handle interrupts during pattern matching + * Jun T: 32497: Test/X02zlevi.ztst, Test/comptest: avoid using comptesteval in the middle of a series of tests; the change in control required for sourcing the command file can confuse the diff --git a/Src/pattern.c b/Src/pattern.c index b79c3b444..94a299ebb 100644 --- a/Src/pattern.c +++ b/Src/pattern.c @@ -2223,6 +2223,8 @@ pattryrefs(Patprog prog, char *string, int stringlen, int unmetalen, return ret; } else { + int q = queue_signal_level(); + /* * Test for a `must match' string, unless we're scanning for a match * in which case we don't need to do this each time. @@ -2270,6 +2272,8 @@ pattryrefs(Patprog prog, char *string, int stringlen, int unmetalen, patinput = patinstart; + dont_queue_signals(); + if (patmatch((Upat)progstr)) { /* * we were lazy and didn't save the globflags if an exclusion @@ -2406,6 +2410,8 @@ pattryrefs(Patprog prog, char *string, int stringlen, int unmetalen, } else ret = 0; + restore_queue_signals(q); + if (tryalloced) zfree(tryalloced, unmetalen + unmetalenp); @@ -2485,7 +2491,7 @@ patmatch(Upat prog) zrange_t from, to, comp; patint_t nextch; - while (scan) { + while (scan && !errflag) { next = PATNEXT(scan); if (!globdots && P_NOTDOT(scan) && patinput == patinstart && -- cgit 1.4.1