From 2e2270ccc788ec76005858a924a68e5b2ced2deb Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 7 Jan 2023 08:07:06 -1000 Subject: [PATCH] SCP: Reasonably format output after EOF return from read_line_p --- scp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index e2f32fc5..758acae6 100644 --- a/scp.c +++ b/scp.c @@ -6038,6 +6038,8 @@ if (sim_switches & SWMASK ('P')) { strlcat (prompt, " ", sizeof (prompt)); if (sim_rem_cmd_active_line == -1) { cptr = read_line_p (prompt, cbuf, sizeof(cbuf), stdin); + if (cptr == NULL) + printf ("\n"); if ((cptr == NULL) || (*cptr == 0)) cptr = deflt; else @@ -10869,6 +10871,8 @@ if (sim_switches & SWMASK ('N')) if (sim_rem_cmd_active_line != -1) return deflt; cptr = read_line_p (ques, cbuf, sizeof(cbuf), stdin); +if (cptr == NULL) + printf ("\n"); if ((cptr == NULL) || (*cptr == 0)) return deflt; if ((*cptr == 'Y') || (*cptr == 'y')) @@ -15489,9 +15493,7 @@ while (TRUE) { } if (!cptr) { /* EOF, exit help */ -#if !defined(_WIN32) printf ("\n"); -#endif break; }