]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Treat lines starting with '#' as comments in PSFTP.
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Mon, 24 Nov 2008 18:19:55 +0000 (18:19 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Mon, 24 Nov 2008 18:19:55 +0000 (18:19 +0000)
[originally from svn r8325]

doc/psftp.but
psftp.c

index d8f0a4185319fd9b4a7276003cb712a80d3bd7cd..be8ac3f628823910aa5596544baee5895752b014 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 63446d4d694fe5294c5863ea1784155ba50611eb..fe01b1a9b500f3edf16a770df9fc524f9358d5ee 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 {
 
        /*