From 1ef4dce9c5e794e746d141f72168ad0275b5b68d Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 24 Nov 2008 18:19:55 +0000 Subject: [PATCH] Treat lines starting with '#' as comments in PSFTP. git-svn-id: svn://svn.tartarus.org/sgt/putty@8325 cda61777-01e9-0310-a592-d414129be87e --- doc/psftp.but | 3 +++ psftp.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/doc/psftp.but b/doc/psftp.but index d8f0a418..be8ac3f6 100644 --- a/doc/psftp.but +++ b/doc/psftp.but @@ -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 63446d4d..fe01b1a9 100644 --- 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 { /* -- 2.11.0