eg0rmaffin

match

Jul 14th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. int        match(char *s1, char *s2)
  2. {
  3.     if ((*s1 == '\0') && (*s1 == '\0') && (*s1 == *s2))
  4.         return (1);
  5.     if ((*s1 != '\0') && (*s2 == '*'))
  6.         return (match(++s1, s2) || match(s1, ++s2));
  7.     if ((*s1 == '\0') && (*s2 == '*'))
  8.         return (match(s1, ++s2));
  9.     if (*s1 == *s2)
  10.         return (match(++s1, ++s2));
  11.     else
  12.         return (0);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment