mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Clarify why filters could be rejected with a proper message
This commit is contained in:
parent
615d393379
commit
aef11798b0
3 changed files with 4 additions and 1 deletions
|
|
@ -84,7 +84,7 @@ struct snapraid_filter* filter_alloc_file(int direction, const char* pattern)
|
|||
filter->is_dir = 0;
|
||||
}
|
||||
|
||||
/* a slash must be the first char, as we reject PATH/DIR/FILE */
|
||||
/* a slash must be the first char, as we don't support PATH/FILE and PATH/DIR/ */
|
||||
if (filter->pattern[0] != '/') {
|
||||
/* LCOV_EXCL_START */
|
||||
free(filter);
|
||||
|
|
|
|||
|
|
@ -468,6 +468,7 @@ int main(int argc, char* argv[])
|
|||
if (!filter) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Invalid filter specification '%s'\n", optarg);
|
||||
log_fatal("Filters using relative paths are not supported. Ensure to add an initial slash\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -886,6 +886,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
if (!filter) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Invalid 'exclude' specification '%s' in '%s' at line %u\n", buffer, path, line);
|
||||
log_fatal("Filters using relative paths are not supported. Ensure to add an initial slash\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
@ -912,6 +913,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
if (!filter) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal("Invalid 'include' specification '%s' in '%s' at line %u\n", buffer, path, line);
|
||||
log_fatal("Filters using relative paths are not supported. Ensure to add an initial slash\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue