From 1928de576cb2e0ee617a95f9d6c4a04284540fba Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Mon, 26 Oct 2015 15:27:22 +0100 Subject: change fnmatch flags such that * in ~~ matches / too (like find(1)) --- lr.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'lr.c') diff --git a/lr.c b/lr.c index a75b739..5fc1f14 100644 --- a/lr.c +++ b/lr.c @@ -701,18 +701,12 @@ eval(struct expr *e, struct fileinfo *fi) case PROP_USER: s = username(fi->sb.st_uid); break; } switch (e->op) { - case EXPR_STREQ: - return strcmp(e->b.string, s) == 0; - case EXPR_STREQI: - return strcasecmp(e->b.string, s) == 0; - case EXPR_GLOB: - return fnmatch(e->b.string, s, FNM_PATHNAME) == 0; - case EXPR_GLOBI: - return fnmatch(e->b.string, s, - FNM_PATHNAME | FNM_CASEFOLD) == 0; + case EXPR_STREQ: return strcmp(e->b.string, s) == 0; + case EXPR_STREQI: return strcasecmp(e->b.string, s) == 0; + case EXPR_GLOB: return fnmatch(e->b.string, s, 0) == 0; + case EXPR_GLOBI: return fnmatch(e->b.string, s, FNM_CASEFOLD) == 0; case EXPR_REGEX: - case EXPR_REGEXI: - return regexec(e->b.regex, s, 0, 0, 0) == 0; + case EXPR_REGEXI: return regexec(e->b.regex, s, 0, 0, 0) == 0; } } } -- cgit 1.4.1