From: Markus Koschany Date: Tue, 17 Feb 2026 15:12:46 +0100 Subject: Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828748 Forwarded: not-needed Last-Update: 2024-12-07 --- tools/cpp/src/cpp-build/generate_geocoding_data.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/cpp/src/cpp-build/generate_geocoding_data.cc b/tools/cpp/src/cpp-build/generate_geocoding_data.cc index 17120b5..63c4999 100644 --- a/tools/cpp/src/cpp-build/generate_geocoding_data.cc +++ b/tools/cpp/src/cpp-build/generate_geocoding_data.cc @@ -91,6 +91,7 @@ class DirEntry { const std::string& name() const { return name_; } DirEntryKinds kind() const { return kind_; } + bool operator<(const DirEntry& d) { return name_ < d.name() || kind_ < d.kind(); } private: std::string name_; @@ -118,6 +119,7 @@ bool ListDirectory(const string& path, vector* entries) { errno = 0; entry = readdir(dir); if (entry == NULL) { + std::sort(entries->begin(), entries->end()); return errno == 0; } if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { @@ -125,6 +127,7 @@ bool ListDirectory(const string& path, vector* entries) { } const string entry_path = path + "/" + entry->d_name; if (stat(entry_path.c_str(), &entry_stat)) { + std::sort(entries->begin(), entries->end()); return false; } DirEntryKinds kind = kFile;