X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/2e528220e71dea5e16fcc877e061f983ab2d837e..2c2bce14fdc3076f357ac1841761a8717e590d22:/psftp.c diff --git a/psftp.c b/psftp.c index cb5add3f..fe01b1a9 100644 --- a/psftp.c +++ b/psftp.c @@ -707,7 +707,7 @@ int sftp_put_file(char *fname, char *outfname, int recurse, int restart) if (!xfer_done(xfer)) { pktin = sftp_recv(); ret = xfer_upload_gotpkt(xfer, pktin); - if (!ret) { + if (ret <= 0 && !err) { printf("error while writing: %s\n", fxp_error()); err = 1; } @@ -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 { /*