Treat lines starting with '#' as comments in PSFTP.
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Mon, 24 Nov 2008 18:19:55 +0000 (18:19 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Mon, 24 Nov 2008 18:19:55 +0000 (18:19 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@8325 cda61777-01e9-0310-a592-d414129be87e

doc/psftp.but
psftp.c

index d8f0a41..be8ac3f 100644 (file)
@@ -143,6 +143,9 @@ Once you have started your PSFTP session, you will see a \c{psftp>}
 prompt. You can now type commands to perform file-transfer
 functions. This section lists all the available commands.
 
+Any line starting with a \cw{#} will be treated as a \i{comment}
+and ignored.
+
 \S{psftp-quoting} \I{quoting, in PSFTP}General quoting rules for PSFTP commands
 
 Most PSFTP commands are considered by the PSFTP command interpreter
diff --git a/psftp.c b/psftp.c
index 63446d4..fe01b1a 100644 (file)
--- a/psftp.c
+++ b/psftp.c
@@ -2240,6 +2240,11 @@ struct sftp_command *sftp_getcmd(FILE *fp, int mode, int modeflags)
        cmd->words = sresize(cmd->words, cmd->wordssize, char *);
        cmd->words[0] = dupstr("!");
        cmd->words[1] = dupstr(p+1);
+    } else if (*p == '#') {
+       /*
+        * Special case: comment. Entire line is ignored.
+        */
+       cmd->nwords = cmd->wordssize = 0;
     } else {
 
        /*