Fix directive.

This commit is contained in:
Ray Hayes 2016-10-18 18:15:53 -07:00
parent f5c9367145
commit 38f8da0160

10
sftp.c
View File

@ -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 &&