Ping, diff reattached with extra context for easier review.

On Wed, Jul 21, 2021 at 12:10:31PM +0200, Martin Vahlensieck wrote:
> Hi
> 
> After the last commit where consecutive `*' are folded, *pattern is
> never '*' here.
> 
> Best,
> 
> Martin
> 
> Index: match.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/ssh/match.c,v
> retrieving revision 1.43
> diff -u -p -r1.43 match.c
> --- match.c   3 Nov 2020 22:53:12 -0000       1.43
> +++ match.c   21 Jul 2021 09:59:59 -0000
> @@ -69,7 +69,7 @@ match_pattern(const char *s, const char 
>                               return 1;
>  
>                       /* If next character in pattern is known, optimize. */
> -                     if (*pattern != '?' && *pattern != '*') {
> +                     if (*pattern != '?') {
>                               /*
>                                * Look instances of the next character in
>                                * pattern, and try to match starting from
> 

Index: match.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/match.c,v
retrieving revision 1.43
diff -u -p -U12 -r1.43 match.c
--- match.c     3 Nov 2020 22:53:12 -0000       1.43
+++ match.c     10 Aug 2021 14:31:45 -0000
@@ -60,25 +60,25 @@ match_pattern(const char *s, const char 
                        return !*s;
 
                if (*pattern == '*') {
                        /* Skip this and any consecutive asterisks. */
                        while (*pattern == '*')
                                pattern++;
 
                        /* If at end of pattern, accept immediately. */
                        if (!*pattern)
                                return 1;
 
                        /* If next character in pattern is known, optimize. */
-                       if (*pattern != '?' && *pattern != '*') {
+                       if (*pattern != '?') {
                                /*
                                 * Look instances of the next character in
                                 * pattern, and try to match starting from
                                 * those.
                                 */
                                for (; *s; s++)
                                        if (*s == *pattern &&
                                            match_pattern(s + 1, pattern + 1))
                                                return 1;
                                /* Failed. */
                                return 0;
                        }

Reply via email to