diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-08-01 16:37:47 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-08-01 17:14:28 +0200 |
commit | daf3f2c11ff467b600473a2fda7bd513aacc1efa (patch) | |
tree | 2f69efd2cff7f7801b16ebe6a8c5b35cccf90065 /src/libutil/archive.cc | |
parent | 1c208f2b7ef8ffb5e6d435d703dad83223a67bd6 (diff) |
Make readDirectory() return inode / file type
Diffstat (limited to 'src/libutil/archive.cc')
-rw-r--r-- | src/libutil/archive.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index 5450fd2f7..6856ea0f2 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<string, string> 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)) { |