=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/match.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- src/usr.bin/ssh/match.c 2020/07/05 23:59:45 1.42 +++ src/usr.bin/ssh/match.c 2020/11/03 22:53:12 1.43 @@ -1,4 +1,4 @@ -/* $OpenBSD: match.c,v 1.42 2020/07/05 23:59:45 djm Exp $ */ +/* $OpenBSD: match.c,v 1.43 2020/11/03 22:53:12 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -51,7 +51,6 @@ * Returns true if the given string matches the pattern (which may contain ? * and * as wildcards), and zero if it does not match. */ - int match_pattern(const char *s, const char *pattern) { @@ -61,8 +60,9 @@ return !*s; if (*pattern == '*') { - /* Skip the asterisk. */ - pattern++; + /* Skip this and any consecutive asterisks. */ + while (*pattern == '*') + pattern++; /* If at end of pattern, accept immediately. */ if (!*pattern)