=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/readconf.c,v retrieving revision 1.105 retrieving revision 1.106 diff -u -r1.105 -r1.106 --- src/usr.bin/ssh/readconf.c 2003/04/02 09:48:07 1.105 +++ src/usr.bin/ssh/readconf.c 2003/04/09 12:00:37 1.106 @@ -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" @@ -279,6 +279,13 @@ size_t len; 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). */