mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 21:00:16 -05:00
Checks for duplicate content file. Thanks Chronial!
This commit is contained in:
parent
5d8f17dcd1
commit
486f623b0d
1 changed files with 13 additions and 0 deletions
13
state.c
13
state.c
|
|
@ -613,6 +613,19 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check if the content file is already specified */
|
||||||
|
for(i=state->contentlist;i!=0;i=i->next) {
|
||||||
|
content = i->data;
|
||||||
|
if (pathcmp(content->content, buffer) == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (i) {
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
fprintf(stderr, "Duplicate 'content' specification in '%s' at line %u\n", path, line);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
}
|
||||||
|
|
||||||
/* get the device of the directory containing the content file */
|
/* get the device of the directory containing the content file */
|
||||||
pathimport(device, sizeof(device), buffer);
|
pathimport(device, sizeof(device), buffer);
|
||||||
slash = strrchr(device, '/');
|
slash = strrchr(device, '/');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue