From 3167ec4048c518d0e8832905a4a5d6b195f0c833 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 1 Oct 2013 18:22:41 +0200 Subject: [PATCH] Adds support for filename containing newlines. --- HISTORY | 1 + scan.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 9bdc81d9..b110ffc7 100644 --- a/HISTORY +++ b/HISTORY @@ -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 ========== diff --git a/scan.c b/scan.c index 3d29dd66..c7a2c141 100644 --- a/scan.c +++ b/scan.c @@ -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); }