If ctrl_c was pressed to clear existing line and go to new line * If we see two ctrl_c in a row we exit. * However, after a ctrl_c if user typed something * (rl_line_buffer is not empty) and then issue a ctrl_c then dont exit. */
| 1983 | * (rl_line_buffer is not empty) and then issue a ctrl_c then dont exit. |
| 1984 | */ |
| 1985 | static void int_handler(int signum) |
| 1986 | { |
| 1987 | if (gbl_in_stmt && !gbl_sent_cancel_cnonce) |
| 1988 | printf("Requesting to cancel query (press Ctrl-C to exit program). " |
| 1989 | "Please wait...\n"); |
| 1990 | if (gbl_sent_cancel_cnonce) exit(1); // pressed ctrl-c again |
| 1991 | if (!gbl_in_stmt) { |
| 1992 | rl_crlf(); |
| 1993 | rl_on_new_line(); |
| 1994 | rl_replace_line("", 0); |
| 1995 | rl_redisplay(); |
| 1996 | } |
| 1997 | send_cancel_cnonce(cdb2_cnonce(cdb2h)); |
| 1998 | } |
| 1999 | |
| 2000 | int main(int argc, char *argv[]) |
| 2001 | { |
nothing calls this directly
no test coverage detected