]> andersk Git - gssapi-openssh.git/blobdiff - openssh/misc.c
o Bump version to 2.7.
[gssapi-openssh.git] / openssh / misc.c
index e9fcef6ca3018c88a1d7fd9e776df351b769c3ff..eac6ccd5802fc95e318a54f8e7abd6ed5f6c2f02 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: misc.c,v 1.19 2002/03/04 17:27:39 stevesk Exp $");
+RCSID("$OpenBSD: misc.c,v 1.20 2002/12/13 10:03:15 markus Exp $");
 
 #include "misc.h"
 #include "log.h"
@@ -105,7 +105,7 @@ set_nodelay(int fd)
                return;
        }
        opt = 1;
-       debug("fd %d setting TCP_NODELAY", fd);
+       debug2("fd %d setting TCP_NODELAY", fd);
        if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof opt) == -1)
                error("setsockopt TCP_NODELAY: %.100s", strerror(errno));
 }
@@ -113,11 +113,14 @@ set_nodelay(int fd)
 /* Characters considered whitespace in strsep calls. */
 #define WHITESPACE " \t\r\n"
 
+/* Characters considered as quotations. */
+#define QUOTES "'\""
+
 /* return next token in configuration line */
 char *
 strdelim(char **s)
 {
-       char *old;
+       char *old, *p, *q;
        int wspace = 0;
 
        if (*s == NULL)
@@ -125,7 +128,22 @@ strdelim(char **s)
 
        old = *s;
 
-       *s = strpbrk(*s, WHITESPACE "=");
+        if ((q=strchr(QUOTES, (int) *old)) && *q)
+        {
+            /* find next quote character, point old to start of quoted
+             * string */
+            for (p = ++old;*p && *p!=*q; p++)
+                 ;
+            
+            /* find start of next token */
+            *s = (*p) ? p + strspn(p + 1, WHITESPACE) + 1 : NULL;
+            
+            /* terminate 'old' token */
+            *p = '\0';
+            return (old);
+        }
+
+        *s = strpbrk(*s, WHITESPACE "=");
        if (*s == NULL)
                return (old);
 
This page took 0.036347 seconds and 4 git commands to generate.