Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <alex@maps.me>2015-07-03 15:35:33 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:54:33 +0300
commit7845b9c6e31756d8a56bb3709186f691361903d6 (patch)
tree2c36e45c4efa258c99f7abee6993c941e42347a8 /3party/Alohalytics
parent54403b75821fe1504fb958f4b7da4a0943389885 (diff)
[alohalytics] Correctly find extension at the very end of the file path.
Diffstat (limited to '3party/Alohalytics')
-rw-r--r--3party/Alohalytics/src/messages_queue.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/3party/Alohalytics/src/messages_queue.h b/3party/Alohalytics/src/messages_queue.h
index b8b821d6e3..54fa628552 100644
--- a/3party/Alohalytics/src/messages_queue.h
+++ b/3party/Alohalytics/src/messages_queue.h
@@ -207,7 +207,8 @@ class MessagesQueue final {
}
FileManager::ForEachFileInDir(storage_directory_, [&processor, &result](const std::string & full_path_to_file) {
// Ignore non-archived files.
- if (full_path_to_file.find(kArchivedFilesExtension) == std::string::npos) {
+ const auto pos = full_path_to_file.rfind(kArchivedFilesExtension);
+ if (pos == std::string::npos || pos + sizeof(kArchivedFilesExtension) - 1 != full_path_to_file.size()) {
return true;
}
if (processor(true /* true here means that second parameter is file path */, full_path_to_file)) {