diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2001-12-03 19:53:08 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2001-12-03 19:53:08 +0000 |
commit | aa286a1e134faeeadbc46ce457b1914ce6de465d (patch) | |
tree | 3b9c332743f7b5210e1ffb614942bb80bdeb556f /libexec/ftp-proxy | |
parent | c5206ffe5a03b004fe01ab58ffff289c46aebc85 (diff) |
Ignore leading whitespace in commands. From Frank Denis. Closes PR 2226.
Diffstat (limited to 'libexec/ftp-proxy')
-rw-r--r-- | libexec/ftp-proxy/getline.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libexec/ftp-proxy/getline.c b/libexec/ftp-proxy/getline.c index c63231cbd4a..4ed10e4a11a 100644 --- a/libexec/ftp-proxy/getline.c +++ b/libexec/ftp-proxy/getline.c @@ -39,6 +39,7 @@ #include <netinet/in.h> #include <arpa/telnet.h> +#include <ctype.h> #include <errno.h> #include <stdlib.h> #include <stdio.h> @@ -262,6 +263,10 @@ telnet_getline(register struct csiob *iobp, struct csiob *telnet_passthrough) /* +1 is for the newline */ clen = (ix+1) - iobp->next_byte; + while (clen > 0 && isspace(iobp->io_buffer[iobp->next_byte])) { + iobp->next_byte++; + clen--; + } memcpy(iobp->line_buffer, &iobp->io_buffer[iobp->next_byte], clen); iobp->next_byte += clen; |