aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--input.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/input.c b/input.c
index 90b6232..718b7cd 100644
--- a/input.c
+++ b/input.c
@@ -24,8 +24,8 @@ char input_buf[MAXIN];
int iptr;
double value, saved, stored=0;
-void paste();
-void copy();
+void paste(void);
+void copy(void);
void bell(void) {
if(!quiet)
@@ -85,6 +85,7 @@ show_value()
set_string("Err");
bell();
showing_err = 1;
+ value = 0; /* so it doesn't get saved on exit! */
return;
}
@@ -237,9 +238,18 @@ key(char c)
feclearexcept(FE_ALL_EXCEPT);
- if(showing_err && c != 27 && c != 'C') {
- bell();
- return;
+ if(showing_err) {
+ switch(c) {
+ /* list the keys that should be still active in error state */
+ case 27:
+ case 'C':
+ case 'Q':
+ case 17:
+ break;
+ default:
+ bell();
+ return;
+ }
}
switch (c)
@@ -489,13 +499,13 @@ static char *bmap[] = {
};
void
-copy()
+copy(void)
{
XSetSelectionOwner(display, XA_PRIMARY, window, event.xbutton.time);
}
void
-paste()
+paste(void)
{
XConvertSelection(display, XA_PRIMARY, XA_STRING, paste_atom, window,
event.xbutton.time);