From e9cb8d59c2982a5d0b2c36da4922e01f1255b5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= Date: Thu, 8 Sep 2011 15:31:16 +0200 Subject: [PATCH] do not mask SIGINT in dc when reading from stdin (#697340) --- bc-1.06.95-sigintmasking.patch | 27 +++++++++++++++++++++++++++ bc.spec | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 bc-1.06.95-sigintmasking.patch diff --git a/bc-1.06.95-sigintmasking.patch b/bc-1.06.95-sigintmasking.patch new file mode 100644 index 0000000..c86340f --- /dev/null +++ b/bc-1.06.95-sigintmasking.patch @@ -0,0 +1,27 @@ +Binary files bc-1.06.95-orig/dc/.dc.c.swp and bc-1.06.95/dc/.dc.c.swp differ +diff -urNp bc-1.06.95-orig/dc/eval.c bc-1.06.95/dc/eval.c +--- bc-1.06.95-orig/dc/eval.c 2006-06-04 13:04:40.000000000 +0200 ++++ bc-1.06.95/dc/eval.c 2011-09-08 15:11:48.815060585 +0200 +@@ -661,7 +661,9 @@ dc_evalfile DC_DECLARG((fp)) + int next_negcmp = 0; + dc_data datum; + +- signal(SIGINT, dc_trap_interrupt); ++ /* Do not mask SIGINT when running from stdin */ ++ if (fp != stdin) ++ signal(SIGINT, dc_trap_interrupt); + stdin_lookahead = EOF; + for (c=getc(fp); c!=EOF; c=peekc){ + peekc = getc(fp); +diff -urNp bc-1.06.95-orig/doc/dc.texi bc-1.06.95/doc/dc.texi +--- bc-1.06.95-orig/doc/dc.texi 2006-06-11 10:15:54.000000000 +0200 ++++ bc-1.06.95/doc/dc.texi 2011-09-08 15:09:37.032059798 +0200 +@@ -126,6 +126,8 @@ To exit, use @samp{q}. + (or whatever other keystroke your system uses to generate a @code{SIGINT}) + does not exit; + it is used to abort macros that are looping, etc. ++This is not true if running on stdin to prevent accidental user confusion ++about @kbd{C-c} unfunctionality. + + A reverse-polish calculator stores numbers on a stack. + Entering a number pushes it on the stack. diff --git a/bc.spec b/bc.spec index c8774cf..e0a8a4c 100644 --- a/bc.spec +++ b/bc.spec @@ -1,7 +1,7 @@ Summary: GNU's bc (a numeric processing language) and dc (a calculator) Name: bc Version: 1.06.95 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ URL: http://www.gnu.org/software/bc/ Group: Applications/Engineering @@ -9,6 +9,7 @@ Source: ftp://alpha.gnu.org/pub/gnu/bc/bc-%{version}.tar.bz2 Patch1: bc-1.06-dc_ibase.patch Patch2: bc-1.06.95-memleak.patch Patch3: bc-1.06.95-matlib.patch +Patch4: bc-1.06.95-sigintmasking.patch Requires(post): /sbin/install-info Requires(preun): /sbin/install-info Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -28,6 +29,7 @@ if you would like to use its text mode calculator. %patch1 -p1 -b .dc_ibase %patch2 -p1 -b .memleak %patch3 -p1 -b .matlib +%patch4 -p1 -b .sigintmask %build %configure --with-readline @@ -67,6 +69,9 @@ fi %{_infodir}/* %changelog +* Thu Sep 08 2011 Ondrej Vasik 1.06.95-4 +- do not mask SIGINT in dc when reading from stdin (#697340) + * Mon Feb 07 2011 Fedora Release Engineering - 1.06.95-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild