[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.125 and 1.126

version 1.125, 2018/03/03 03:15:51 version 1.126, 2018/03/07 23:53:08
Line 217 
Line 217 
 char *  char *
 strdelim(char **s)  strdelim(char **s)
 {  {
         char *old, *cp;          char *old;
         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 */
                 for (cp = *s; ; cp++) {                  if ((*s = strpbrk(*s, QUOTE)) == NULL) {
                         if (*cp == '\0')                          return (NULL);          /* no matching quote */
                                 return NULL; /* no matching quote */                  } else {
                         if (*cp == '\\') {                          *s[0] = '\0';
                                 /* Escape sequence */                          *s += strspn(*s + 1, WHITESPACE) + 1;
                                 if (cp[1] == '\"' || cp[1] == '\'' ||                          return (old);
                                     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.125  
changed lines
  Added in v.1.126