Blame SOURCES/bc-1.06.95-sigintmasking.patch

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