[BACK]Return to misc.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/misc.c between version 1.123 and 1.124

version 1.123, 2018/01/08 15:21:49 version 1.124, 2018/03/02 03:02:11
Line 217 
Line 217 
 char *  char *
 strdelim(char **s)  strdelim(char **s)
 {  {
         char *old;          char *old, *cp;
         int wspace = 0;          int wspace = 0;
   
         if (*s == NULL)          if (*s == NULL)
Line 231 
Line 231 
   
         if (*s[0] == '\"') {          if (*s[0] == '\"') {
                 memmove(*s, *s + 1, strlen(*s)); /* move nul too */                  memmove(*s, *s + 1, strlen(*s)); /* move nul too */
   
                 /* Find matching quote */                  /* Find matching quote */
                 if ((*s = strpbrk(*s, QUOTE)) == NULL) {                  for (cp = *s; ; cp++) {
                         return (NULL);          /* no matching quote */                          if (*cp == '\0')
                 } else {                                  return NULL; /* no matching quote */
                         *s[0] = '\0';                          if (*cp == '\\') {
                         *s += strspn(*s + 1, WHITESPACE) + 1;                                  /* Escape sequence */
                         return (old);                                  if (cp[1] == '\"' || cp[1] == '\'' ||
                                       cp[1] == '\\') {
                                           memmove(cp, cp + 1, strlen(cp));
                                           continue;
                                   }
                                   return NULL; /* invalid escape */
                           } else if (*cp == '\"') {
                                   *(cp++) = '\0';
                                   *s += strspn(cp, WHITESPACE);
                                   return old;
                           }
                 }                  }
         }          }
   

Legend:
Removed from v.1.123  
changed lines
  Added in v.1.124