Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- match_orig.c 2017-08-19 13:37:11.000000000 -0700
- +++ match_2.c 2017-08-19 13:40:33.000000000 -0700
- @@ -1,20 +1,24 @@
- -// zaya popen'
- int match(char *s1, char *s2)
- {
- if (!(*s1) && !(*s2))
- return (1);
- - if (*s2 == '*' && *(s2 + 1) != '\0' && *s1 == '\0')
- - return (0);
- -
- - if (*s2 == '*' && *(s2 + 1) == '*')
- - return match(s1, s2 + 1);
- -
- if (*s2 == *s1)
- return (match(s1 + 1, s2 + 1));
- + if (*s1 == 0 && *s2 == '*')
- + return match(s1, s2 + 1);
- +
- if (*s2 == '*')
- return (match(s1 + 1, s2) || match(s1, s2 + 1));
- +
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement