--- glob.c.old Wed Oct 21 07:01:46 1998 +++ glob.c Mon Apr 17 15:55:30 2000 @@ -34,23 +34,13 @@ extern bool lmatch(List *s, List *p) { List *q; - int i; - bool okay; if (s == NULL) { if (p == NULL) /* null matches null */ return TRUE; - for (; p != NULL; p = p->n) { /* one or more stars match null */ - if (*p->w != '\0') { /* the null string is a special case; it does *not* match () */ - okay = TRUE; - for (i = 0; p->w[i] != '\0'; i++) - if (p->w[i] != '*' || p->m[i] != 1) { - okay = FALSE; - break; - } - if (okay) - return TRUE; - } - } + for (; p != NULL; p = p->n) /* one or more stars match null */ + if (p->w && strspn(p->w, "*") == strlen(p->w) && + p->m && strspn(p->m, "\001") == strlen(p->m)) + return TRUE; return FALSE; } for (; s != NULL; s = s->n)