On Fri, 2011-05-06 at 18:12 -0700, [email protected] wrote: > From: David Lutterkort <[email protected]> > > --- > src/regexp.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ > src/regexp.h | 3 +++ > 2 files changed, 51 insertions(+), 0 deletions(-) > > diff --git a/src/regexp.c b/src/regexp.c > index b5978d2..f351799 100644 > --- a/src/regexp.c > +++ b/src/regexp.c > @@ -134,6 +134,54 @@ struct regexp *make_regexp(struct info *info, char *pat, > int nocase) { > return regexp; > } > > +/* Take a POSIX glob and turn it into a regexp. The regexp is constructed > + * by doing the following translations of characters in the string: > + * * -> .* > + * ? -> . > + * leave characters escaped with a backslash alone > + * escape any of ".|{}()+^$" with a backslash > + * > + * Note that that ignores some of the finer points of globs, like > + * complementation. > + */ > +struct regexp *make_regexp_from_glob(struct info *info, const char *glob) {
This incorrectly led to the '*' in a glob to match across '/'; I've changed the code so that a '*' in a glob is synonymous to the regexp [^/]* David _______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
