From 43ca8741b014cbac7bda7f3022037c99031382a5 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sun, 21 Mar 2004 22:01:41 +0000 Subject: [PATCH] echo ^C to stdout, not stdin or stderr. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@809 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/break.c | 2 +- kernel/chario.c | 7 +------ kernel/proto.h | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/kernel/break.c b/kernel/break.c index 8be3b8e..d3d24c5 100644 --- a/kernel/break.c +++ b/kernel/break.c @@ -68,7 +68,7 @@ int check_handle_break(void) */ void handle_break(struct dhdr FAR **pdev) { - echo_char_stdin(CTL_C); + echo_char(CTL_C, get_sft_idx(STDOUT)); con_flush(pdev); if (!ErrorMode) /* within int21_handler, InDOS is not incremented */ if (InDOS) diff --git a/kernel/chario.c b/kernel/chario.c index 93ea5f7..eaf3d92 100644 --- a/kernel/chario.c +++ b/kernel/chario.c @@ -306,7 +306,7 @@ void write_char_stdout(int c) #define iscntrl(c) ((unsigned char)(c) < ' ') /* this is for handling things like ^C, mostly used in echoed input */ -STATIC int echo_char(int c, int sft_idx) +int echo_char(int c, int sft_idx) { int out = c; if (iscntrl(c) && c != HT && c != LF && c != CR) @@ -318,11 +318,6 @@ STATIC int echo_char(int c, int sft_idx) return c; } -int echo_char_stdin(int c) -{ - return echo_char(c, get_sft_idx(STDIN)); -} - STATIC void destr_bs(int sft_idx) { write_char(BS, sft_idx); diff --git a/kernel/proto.h b/kernel/proto.h index fc62a74..3471a11 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -58,7 +58,7 @@ void handle_break(struct dhdr FAR **pdev); struct dhdr FAR *sft_to_dev(sft FAR *sft); long BinaryCharIO(struct dhdr FAR **pdev, size_t n, void FAR * bp, unsigned command); -int echo_char_stdin(int c); +int echo_char(int c, int sft_idx); int con_break(void); int StdinBusy(void); void con_flush(struct dhdr FAR **pdev);