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

Diff for /src/usr.bin/ssh/match.c between version 1.42 and 1.43

version 1.42, 2020/07/05 23:59:45 version 1.43, 2020/11/03 22:53:12
Line 51 
Line 51 
  * Returns true if the given string matches the pattern (which may contain ?   * Returns true if the given string matches the pattern (which may contain ?
  * and * as wildcards), and zero if it does not match.   * and * as wildcards), and zero if it does not match.
  */   */
   
 int  int
 match_pattern(const char *s, const char *pattern)  match_pattern(const char *s, const char *pattern)
 {  {
Line 61 
Line 60 
                         return !*s;                          return !*s;
   
                 if (*pattern == '*') {                  if (*pattern == '*') {
                         /* Skip the asterisk. */                          /* Skip this and any consecutive asterisks. */
                         pattern++;                          while (*pattern == '*')
                                   pattern++;
   
                         /* If at end of pattern, accept immediately. */                          /* If at end of pattern, accept immediately. */
                         if (!*pattern)                          if (!*pattern)

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43