diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-02-19 18:24:11 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-02-19 18:24:38 +0100 |
commit | 573edeb13b5b71f90fc1d819af6748cb93d5604e (patch) | |
tree | 3883cc37668f52f979d2d58e3165244ef1ca1259 /lib/fstree/fstree_from_file.c | |
parent | 6424676d6332cf00e4146d4b45d00cd2eb25d359 (diff) |
libfstree: reject unknown glob options to allow future expansions
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree/fstree_from_file.c')
-rw-r--r-- | lib/fstree/fstree_from_file.c | 16 |
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') { |