From 38f8da0160049b63ab4f40a7e6eb944fb917d4c7 Mon Sep 17 00:00:00 2001 From: Ray Hayes Date: Tue, 18 Oct 2016 18:15:53 -0700 Subject: [PATCH] Fix directive. --- sftp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sftp.c b/sftp.c index 43ad371..e281bd1 100644 --- a/sftp.c +++ b/sftp.c @@ -2120,6 +2120,7 @@ interactive_loop(struct sftp_conn *conn, char *file1, char *file2) signal(SIGINT, SIG_IGN); if (el == NULL) { +#ifdef WINDOWS if (interactive) { wchar_t wcmd[2048]; printf("sftp> "); @@ -2140,6 +2141,15 @@ interactive_loop(struct sftp_conn *conn, char *file1, char *file2) break; } } +#else + if (interactive) { + printf("sftp> "); + if (fgets(cmd, sizeof(cmd), infile) == NULL) { + if (interactive) + printf("\n"); + break; + } +#endif if (!interactive) { /* Echo command */ printf("sftp> %s", cmd); if (strlen(cmd) > 0 &&