summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-02-19 18:24:11 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-02-19 18:24:38 +0100
commit573edeb13b5b71f90fc1d819af6748cb93d5604e (patch)
tree3883cc37668f52f979d2d58e3165244ef1ca1259 /lib
parent6424676d6332cf00e4146d4b45d00cd2eb25d359 (diff)
libfstree: reject unknown glob options to allow future expansions
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/fstree/fstree_from_file.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/fstree/fstree_from_file.c b/lib/fstree/fstree_from_file.c
index 3663c1c..d852e0b 100644
--- a/lib/fstree/fstree_from_file.c
+++ b/lib/fstree/fstree_from_file.c
@@ -297,7 +297,21 @@ static int glob_files(fstree_t *fs, const char *filename, size_t line_num,
continue;
}
- break;
+ if (extra[0] == '-') {
+ if (extra[1] == '-' && isspace(extra[2])) {
+ extra += 2;
+ while (isspace(*extra))
+ ++extra;
+ break;
+ }
+
+ fprintf(stderr, "%s: " PRI_SZ ": unknown option.\n",
+ filename, line_num);
+ free(ctx.name_pattern);
+ return -1;
+ } else {
+ break;
+ }
}
if (*extra == '\0') {