Skip to content

Commit

Permalink
Use a standardised locale to create log file filenames, fixing issues…
Browse files Browse the repository at this point in the history
… with certain locales

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra authored and backportbot-nextcloud[bot] committed Sep 13, 2023
1 parent 95180b6 commit f6fb318
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libsync/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ void Logger::enterNextLogFileNoLock()
}

// Tentative new log name, will be adjusted if one like this already exists
QDateTime now = QDateTime::currentDateTime();
QString newLogName = now.toString("yyyyMMdd_HHmm") + "_nextcloud.log";
const auto now = QDateTime::currentDateTime();
const auto cLocale = QLocale::c(); // Some system locales generate strings that are incompatible with filesystem
QString newLogName = cLocale.toString(now, QStringLiteral("yyyyMMdd_HHmm")) + QStringLiteral("_nextcloud.log");

// Expire old log files and deal with conflicts
QStringList files = dir.entryList(QStringList("*owncloud.log.*"), QDir::Files, QDir::Name) +
Expand Down

0 comments on commit f6fb318

Please sign in to comment.