mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Fix a bug in the PSFTP command parser which would cause it to
hallucinate an extra empty argument word at the end of a line if the line ended in more than one whitespace character. [originally from svn r9613]
This commit is contained in:
parent
f796f2d2d3
commit
5ebf74d103
5
psftp.c
5
psftp.c
@ -2287,10 +2287,13 @@ struct sftp_command *sftp_getcmd(FILE *fp, int mode, int modeflags)
|
|||||||
* >this has "quotes" in<
|
* >this has "quotes" in<
|
||||||
* >and"this"<
|
* >and"this"<
|
||||||
*/
|
*/
|
||||||
while (*p) {
|
while (1) {
|
||||||
/* skip whitespace */
|
/* skip whitespace */
|
||||||
while (*p && (*p == ' ' || *p == '\t'))
|
while (*p && (*p == ' ' || *p == '\t'))
|
||||||
p++;
|
p++;
|
||||||
|
/* terminate loop */
|
||||||
|
if (!*p)
|
||||||
|
break;
|
||||||
/* mark start of word */
|
/* mark start of word */
|
||||||
q = r = p; /* q sits at start, r writes word */
|
q = r = p; /* q sits at start, r writes word */
|
||||||
quoting = 0;
|
quoting = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user