]> andersk Git - openssh.git/blobdiff - sftp-int.c
- djm@cvs.openbsd.org 2004/01/13 09:25:05
[openssh.git] / sftp-int.c
index edb475bbb0f7b359988e5232fcd55d5220c38391..a9423fe6932c56c1d63b2d6a06b3c5b5df042b71 100644 (file)
@@ -25,7 +25,7 @@
 /* XXX: recursive operations */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-int.c,v 1.65 2003/11/21 11:57:03 djm Exp $");
+RCSID("$OpenBSD: sftp-int.c,v 1.66 2004/01/13 09:25:05 djm Exp $");
 
 #include "buffer.h"
 #include "xmalloc.h"
@@ -41,6 +41,9 @@ RCSID("$OpenBSD: sftp-int.c,v 1.65 2003/11/21 11:57:03 djm Exp $");
 /* File to read commands from */
 extern FILE *infile;
 
+/* Are we in batchfile mode? */
+extern int batchmode;
+
 /* Size of buffer used when copying files */
 extern size_t copy_buffer_len;
 
@@ -1172,14 +1175,16 @@ interactive_loop(int fd_in, int fd_out, char *file1, char *file2)
                if (fgets(cmd, sizeof(cmd), infile) == NULL) {
                        printf("\n");
                        break;
-               } else if (infile != stdin) /* Bluff typing */
+               }
+
+               if (batchmode) /* Echo command */
                        printf("%s", cmd);
 
                cp = strrchr(cmd, '\n');
                if (cp)
                        *cp = '\0';
 
-               err = parse_dispatch_command(conn, cmd, &pwd, infile != stdin);
+               err = parse_dispatch_command(conn, cmd, &pwd, batchmode);
                if (err != 0)
                        break;
        }
This page took 0.028335 seconds and 4 git commands to generate.