summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-05-14 13:40:54 +1000
committerDamien Miller <djm@mindrot.org>2003-05-14 13:40:54 +1000
commitc652cac5f75590a4df536fb69713ba506082f5f4 (patch)
treeea172e22cb2ceb28e3cc08a46626655bc1edaed9 /readconf.c
parentd558092522153caa627e33e4a76c6f64332bc609 (diff)
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2003/04/09 12:00:37 [readconf.c] strip trailing whitespace from config lines before parsing. Fixes bz 528; ok markus@
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/readconf.c b/readconf.c
index a1042708..acdf128f 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.105 2003/04/02 09:48:07 markus Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.106 2003/04/09 12:00:37 djm Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -282,6 +282,13 @@ process_config_line(Options *options, const char *host,
u_short fwd_port, fwd_host_port;
char sfwd_host_port[6];
+ /* Strip trailing whitespace */
+ for(len = strlen(line) - 1; len > 0; len--) {
+ if (strchr(WHITESPACE, line[len]) == NULL)
+ break;
+ line[len] = '\0';
+ }
+
s = line;
/* Get the keyword. (Each line is supposed to begin with a keyword). */
keyword = strdelim(&s);