/*
- * Sherlock Library -- Generic Shell-Like Pattern Matching (currently only '?' and '*')
+ * UCW Library -- Generic Shell-Like Pattern Matching (currently only '?' and '*')
*
- * (c) 1997 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
+ * (c) 1997 Martin Mares <mj@ucw.cz>
+ *
+ * This software may be freely distributed and used according to the terms
+ * of the GNU Lesser General Public License.
*/
int
-MATCH_FUNC_NAME(byte *p, byte *s)
+MATCH_FUNC_NAME(const char *p, const char *s)
{
while (*p)
{
if (z == '\\' && p[2])
z = p[2];
z = Convert(z);
- while (*s)
+ for(;;)
{
while (*s && Convert(*s) != z)
s++;
- if (*s && match_pattern(p+1, s))
+ if (!*s)
+ return 0;
+ if (MATCH_FUNC_NAME(p+1, s))
return 1;
s++;
}
- return 0;
}
else
{