From daf3f2c11ff467b600473a2fda7bd513aacc1efa Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Aug 2014 16:37:47 +0200 Subject: Make readDirectory() return inode / file type --- src/libutil/archive.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/libutil/archive.cc') diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index 5450fd2f7182..6856ea0f2837 100644 --- a/src/libutil/archive.cc +++ b/src/libutil/archive.cc @@ -83,22 +83,21 @@ static void dump(const Path & path, Sink & sink, PathFilter & filter) /* If we're on a case-insensitive system like Mac OS X, undo the case hack applied by restorePath(). */ - Strings names = readDirectory(path); std::map unhacked; - for (auto & i : names) + for (auto & i : readDirectory(path)) if (useCaseHack) { - string name(i); - size_t pos = i.find(caseHackSuffix); + string name(i.name); + size_t pos = i.name.find(caseHackSuffix); if (pos != string::npos) { - printMsg(lvlDebug, format("removing case hack suffix from `%1%'") % (path + "/" + i)); + printMsg(lvlDebug, format("removing case hack suffix from `%1%'") % (path + "/" + i.name)); name.erase(pos); } if (unhacked.find(name) != unhacked.end()) throw Error(format("file name collision in between `%1%' and `%2%'") - % (path + "/" + unhacked[name]) % (path + "/" + i)); - unhacked[name] = i; + % (path + "/" + unhacked[name]) % (path + "/" + i.name)); + unhacked[name] = i.name; } else - unhacked[i] = i; + unhacked[i.name] = i.name; for (auto & i : unhacked) if (filter(path + "/" + i.first)) { -- cgit 1.4.1