bc-1.06.95-sigintmasking.patch 1.1 KB

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