diff --git a/src/adoc.cpp b/src/adoc.cpp index 7fbba92..f1392e6 100644 --- a/src/adoc.cpp +++ b/src/adoc.cpp @@ -124,20 +124,14 @@ void export_adoc(const vector &entries, ostream &out) } else { // Sort by tag names otherwise. - std::locale loc(""); + std::locale loc; const std::collate &coll = std::use_facet>(loc); - if (coll.compare(a.first.data(), a.first.data() - + a.first.length(), - b.first.data(), b.first.data() - + b.first.length()) == -1) - { // -1 == less than - return true; - } - else - { - return false; - } + return (coll.compare( + a.first.data(), a.first.data() + + a.first.length(), + b.first.data(), b.first.data() + + b.first.length()) == -1); } }); diff --git a/src/main.cpp b/src/main.cpp index dcd92ad..a611c4a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include "sqlite.hpp" #include "parse_options.hpp" #include "uri.hpp" @@ -33,6 +34,8 @@ using std::chrono::system_clock; int main(const int argc, const char *argv[]) { + std::locale::global(std::locale("")); // Set locale globally. + options opts = parse_options(argc, argv); if (opts.status_code != 0) {