diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-03-02 10:18:50 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-03-02 10:18:50 +0000 |
commit | aef1460fb26d62736c1bc98d523e1bd996353258 (patch) | |
tree | 535143e2c6d9540861f72d90107b23c365efdc4f /gnu/usr.bin/bc | |
parent | 9539501b8177df17a106ba8572a45a1e29b8d4c2 (diff) |
signal handler repairs; phil@cs.wwu.edu
Diffstat (limited to 'gnu/usr.bin/bc')
-rw-r--r-- | gnu/usr.bin/bc/bc/execute.c | 9 | ||||
-rw-r--r-- | gnu/usr.bin/bc/bc/main.c | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/gnu/usr.bin/bc/bc/execute.c b/gnu/usr.bin/bc/bc/execute.c index c8f3df26135..0ef9bb98795 100644 --- a/gnu/usr.bin/bc/bc/execute.c +++ b/gnu/usr.bin/bc/bc/execute.c @@ -41,8 +41,6 @@ stop_execution (sig) int sig; { had_sigint = TRUE; - printf ("\n"); - rt_error ("interrupted execution"); } @@ -87,10 +85,11 @@ execute () if (interactive) { signal (SIGINT, stop_execution); - had_sigint = FALSE; } - while (pc.pc_addr < functions[pc.pc_func].f_code_size && !runtime_error) + had_sigint = FALSE; + while (pc.pc_addr < functions[pc.pc_func].f_code_size + && !runtime_error && !had_sigint) { inst = byte(&pc); @@ -543,7 +542,7 @@ execute () { signal (SIGINT, use_quit); if (had_sigint) - printf ("Interruption completed.\n"); + printf ("\ninterrupted execution.\n"); } } diff --git a/gnu/usr.bin/bc/bc/main.c b/gnu/usr.bin/bc/bc/main.c index 29a334fb0fb..87a9feb3af2 100644 --- a/gnu/usr.bin/bc/bc/main.c +++ b/gnu/usr.bin/bc/bc/main.c @@ -325,6 +325,6 @@ void use_quit (sig) int sig; { - printf ("\n(interrupt) use quit to exit.\n"); + write (1, "\n(interrupt) use quit to exit.\n", 31); signal (SIGINT, use_quit); } |