summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-02-14 13:35:23 -0500
committerTavian Barnes <tavianator@tavianator.com>2016-02-14 13:35:23 -0500
commit585a9dafe86b51a2d120d107bb04a77b34cc1af0 (patch)
tree7f715d1d8c8a4dd711548f3f19528722a739db00 /parse.c
parent94432cd2a3185ce97dfd28a6a1b236449d91268f (diff)
downloadbfs-585a9dafe86b51a2d120d107bb04a77b34cc1af0.tar.xz
Implement -lname and -ilname.
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 7cdc685..7951589 100644
--- a/parse.c
+++ b/parse.c
@@ -457,6 +457,14 @@ static struct expr *parse_path(struct parser_state *state, const char *option, b
}
/**
+ * Parse -i?lname.
+ */
+static struct expr *parse_lname(struct parser_state *state, const char *option, bool casefold) {
+ struct expr *expr = parse_test_sdata(state, option, eval_lname);
+ return set_fnm_casefold(expr, casefold);
+}
+
+/**
* Parse -noleaf.
*/
static struct expr *parse_noleaf(struct parser_state *state, const char *option) {
@@ -670,7 +678,9 @@ static struct expr *parse_literal(struct parser_state *state) {
break;
case 'i':
- if (strcmp(arg, "-iname") == 0) {
+ if (strcmp(arg, "-ilname") == 0) {
+ return parse_lname(state, arg, true);
+ } if (strcmp(arg, "-iname") == 0) {
return parse_name(state, arg, true);
} else if (strcmp(arg, "-inum") == 0) {
return parse_test_icmp(state, arg, eval_inum);
@@ -682,6 +692,8 @@ static struct expr *parse_literal(struct parser_state *state) {
case 'l':
if (strcmp(arg, "-links") == 0) {
return parse_test_icmp(state, arg, eval_links);
+ } else if (strcmp(arg, "-lname") == 0) {
+ return parse_lname(state, arg, false);
}
break;