Subject: Re: pcvt and TIOCCONS
To: Alan Barrett <firstname.lastname@example.org>
From: Chris G Demetriou <Chris_G_Demetriou@UX2.SP.CS.CMU.EDU>
Date: 04/21/1996 16:22:58
> > > I'd like to see how you would write glob_match.
> > wildmat() seems to do what you want. Here's the head of wildmat.c as
> > distributed with INN:
> Then there's also the code that handles pattern matching for "case"
> statements in /bin/sh. In NetBSD's /bin/sh, that ends up calling
> pmatch() in src/bin/sh/expand.c.
> It seems to me that a function like that should be in a library.
As pointed out by Christos, fnmatch() would seem to be a good match
(heh!) for this application... Not only is it already in the library,
it appears to do the 'appropriate thing,' and the implementation looks
relatively streamlined (i.e. no regexps, allocations, etc.).