Adds support for filename containing newlines.

This commit is contained in:
Andrea Mazzoleni 2013-10-01 18:22:41 +02:00
parent 0e2a2b3f10
commit 3167ec4048
2 changed files with 3 additions and 2 deletions

4
scan.c
View file

@ -695,8 +695,8 @@ static int scan_dir(struct snapraid_scan* scan, struct snapraid_state* state, in
pathprint(path_next, sizeof(path_next), "%s%s", dir, name);
pathprint(sub_next, sizeof(sub_next), "%s%s", sub, name);
/* check for not supported file names, limitation derived from the content file format */
if (name[0] == 0 || strchr(name, '\n') != 0 || name[strlen(name)-1] == '\r') {
/* check for not supported file names */
if (name[0] == 0) {
fprintf(stderr, "Unsupported name '%s' in file '%s'.\n", name, path_next);
exit(EXIT_FAILURE);
}