do not mask SIGINT in dc when reading from stdin (#697340)

This commit is contained in:
Ondřej Vašík 2011-09-08 15:31:16 +02:00
parent 09250fc30d
commit e9cb8d59c2
2 changed files with 33 additions and 1 deletions

View File

@ -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.

View File

@ -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 <ovasik@redhat.com> 1.06.95-4
- do not mask SIGINT in dc when reading from stdin (#697340)
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.06.95-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild