summaryrefslogtreecommitdiff
path: root/zen/file_traverser.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:28:01 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:28:01 +0200
commitfe9eb89ebc1b3c33cbac00a3fa095a14faef9113 (patch)
tree8a3bb620a9acb83fe0057061a86e8f2cb91a9fe1 /zen/file_traverser.cpp
parent5.21 (diff)
downloadFreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.gz
FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.bz2
FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.zip
5.22
Diffstat (limited to 'zen/file_traverser.cpp')
-rw-r--r--zen/file_traverser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/file_traverser.cpp b/zen/file_traverser.cpp
index a3e8491a..959a6071 100644
--- a/zen/file_traverser.cpp
+++ b/zen/file_traverser.cpp
@@ -36,7 +36,7 @@ namespace
template <class Command> inline //function object expecting to throw FileError if operation fails
bool tryReportingDirError(Command cmd, zen::TraverseCallback& callback) //return "true" on success, "false" if error was ignored
{
- for (;;)
+ for (size_t retryNumber = 0;; ++retryNumber)
try
{
cmd(); //throw FileError
@@ -44,7 +44,7 @@ bool tryReportingDirError(Command cmd, zen::TraverseCallback& callback) //return
}
catch (const FileError& e)
{
- switch (callback.reportDirError(e.toString()))
+ switch (callback.reportDirError(e.toString(), retryNumber))
{
case TraverseCallback::ON_ERROR_RETRY:
break;
@@ -57,7 +57,7 @@ bool tryReportingDirError(Command cmd, zen::TraverseCallback& callback) //return
template <class Command> inline //function object expecting to throw FileError if operation fails
bool tryReportingItemError(Command cmd, zen::TraverseCallback& callback, const Zchar* shortName) //return "true" on success, "false" if error was ignored
{
- for (;;)
+ for (size_t retryNumber = 0;; ++retryNumber)
try
{
cmd(); //throw FileError
@@ -65,7 +65,7 @@ bool tryReportingItemError(Command cmd, zen::TraverseCallback& callback, const Z
}
catch (const FileError& e)
{
- switch (callback.reportItemError(e.toString(), shortName))
+ switch (callback.reportItemError(e.toString(), retryNumber, shortName))
{
case TraverseCallback::ON_ERROR_RETRY:
break;
@@ -559,7 +559,7 @@ private:
{
bufferUtfDecomposed.resize(lenMax);
if (::CFStringGetFileSystemRepresentation(cfStr, &bufferUtfDecomposed[0], lenMax)) //get decomposed UTF form (verified!) despite ambiguous documentation
- shortName = &bufferUtfDecomposed[0];
+ shortName = &bufferUtfDecomposed[0]; //attention: => don't access "shortName" after recursion in "traverse"!
}
}
//const char* sampleDecomposed = "\x6f\xcc\x81.txt";
bgstack15