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

View file

@ -9,6 +9,7 @@ SnapRAID HISTORY
It's just a cosmetic change, and not a functional one.
* Remove unexpected 'Restore' entries in the diff output when dealing
with filesystem without persistent inodes like NTFS in Linux.
* Added support for filenames containing newlines. This happens in Mac OS X.
4.1 2013/9
==========

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);
}