2 Proprietary Rand Corporation
, 1981.
3 Further distribution of
this software
4 subject to the terms of the Rand
9 /* glob match subroutine --
11 "*" in params matches r.e ".*"
12 "?" in params matches r.e. "."
13 "[...]" in params matches character class
14 "[...a-z...]" in params matches a through z.
26 if ((scc
= *s
++) && (scc
=& 0177) == 0) scc
= 0200;
33 if (ok
) return(glbmtch(s
, p
));
36 if (lc
<=scc
&& scc
<=(c
= *p
++)) ok
++;
37 } else if (scc
== (lc
=cc
)) ok
++;
41 if (c
!=scc
) return(0);
43 if (scc
) return(glbmtch(s
, p
));
46 return(umatch(--s
, p
));
56 while(*s
) if (glbmtch(s
++,p
)) return(1);