]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- markus@cvs.openbsd.org 2003/02/05 09:02:28
authorDamien Miller <djm@mindrot.org>
Mon, 24 Feb 2003 00:56:27 +0000 (11:56 +1100)
committerDamien Miller <djm@mindrot.org>
Mon, 24 Feb 2003 00:56:27 +0000 (11:56 +1100)
     [readconf.c]
     simplify ProxyCommand parsing, remove strcat/xrealloc; ok henning@, djm@

ChangeLog
readconf.c

index 0ba9fe7a525c9610b20791b9731a6edd706e68df..8fe2de97474cd81d561b280ba67212ff1021768b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,9 @@
      [monitor.c monitor_wrap.c]
      skey/bsdauth: use 0 to indicate failure instead of -1, because
      the buffer API only supports unsigned ints.
+   - markus@cvs.openbsd.org 2003/02/05 09:02:28
+     [readconf.c]
+     simplify ProxyCommand parsing, remove strcat/xrealloc; ok henning@, djm@
 
 20030211
  - (djm) Cygwin needs libcrypt too. Patch from vinschen@redhat.com
      save auth method before monitor_reset_key_state(); bugzilla bug #284;
      ok provos@
 
-$Id: ChangeLog,v 1.2603 2003/02/24 00:55:46 djm Exp $
+$Id: ChangeLog,v 1.2604 2003/02/24 00:56:27 djm Exp $
index b9f1b7ddcc8b1b09f6b92dfa1c1a6890557bc23a..8b576a7adfee874ee07a377976a57059c88e724a 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.101 2002/11/07 22:08:07 markus Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.102 2003/02/05 09:02:28 markus Exp $");
 
 #include "ssh.h"
 #include "xmalloc.h"
@@ -268,14 +268,16 @@ parse_token(const char *cp, const char *filename, int linenum)
  * Processes a single option line as used in the configuration files. This
  * only sets those values that have not already been set.
  */
+#define WHITESPACE " \t\r\n"
 
 int
 process_config_line(Options *options, const char *host,
                    char *line, const char *filename, int linenum,
                    int *activep)
 {
-       char buf[256], *s, *string, **charptr, *endofnumber, *keyword, *arg;
+       char buf[256], *s, **charptr, *endofnumber, *keyword, *arg;
        int opcode, *intptr, value;
+       size_t len;
        u_short fwd_port, fwd_host_port;
        char sfwd_host_port[6];
 
@@ -488,16 +490,9 @@ parse_string:
 
        case oProxyCommand:
                charptr = &options->proxy_command;
-               string = xstrdup("");
-               while ((arg = strdelim(&s)) != NULL && *arg != '\0') {
-                       string = xrealloc(string, strlen(string) + strlen(arg) + 2);
-                       strcat(string, " ");
-                       strcat(string, arg);
-               }
+               len = strspn(s, WHITESPACE "=");
                if (*activep && *charptr == NULL)
-                       *charptr = string;
-               else
-                       xfree(string);
+                       *charptr = xstrdup(s + len);
                return 0;
 
        case oPort: