Blame SOURCES/bc-1.06.95-sigintmasking.patch

747aaa
Binary files bc-1.06.95-orig/dc/.dc.c.swp and bc-1.06.95/dc/.dc.c.swp differ
747aaa
diff -urNp bc-1.06.95-orig/dc/eval.c bc-1.06.95/dc/eval.c
747aaa
--- bc-1.06.95-orig/dc/eval.c	2006-06-04 13:04:40.000000000 +0200
747aaa
+++ bc-1.06.95/dc/eval.c	2011-09-08 15:11:48.815060585 +0200
747aaa
@@ -661,7 +661,9 @@ dc_evalfile DC_DECLARG((fp))
747aaa
 	int next_negcmp = 0;
747aaa
 	dc_data datum;
747aaa
 
747aaa
-	signal(SIGINT, dc_trap_interrupt);
747aaa
+    /* Do not mask SIGINT when running from stdin */
747aaa
+	if (fp != stdin)
747aaa
+      signal(SIGINT, dc_trap_interrupt);
747aaa
 	stdin_lookahead = EOF;
747aaa
 	for (c=getc(fp); c!=EOF; c=peekc){
747aaa
 		peekc = getc(fp);
747aaa
diff -urNp bc-1.06.95-orig/doc/dc.texi bc-1.06.95/doc/dc.texi
747aaa
--- bc-1.06.95-orig/doc/dc.texi	2006-06-11 10:15:54.000000000 +0200
747aaa
+++ bc-1.06.95/doc/dc.texi	2011-09-08 15:09:37.032059798 +0200
747aaa
@@ -126,6 +126,8 @@ To exit, use @samp{q}.
747aaa
 (or whatever other keystroke your system uses to generate a @code{SIGINT})
747aaa
 does not exit;
747aaa
 it is used to abort macros that are looping, etc.
747aaa
+This is not true if running on stdin to prevent accidental user confusion
747aaa
+about @kbd{C-c} unfunctionality.
747aaa
 
747aaa
 A reverse-polish calculator stores numbers on a stack.
747aaa
 Entering a number pushes it on the stack.