From 30843cd36877e21a01856401ccc0037f6f94c5a6 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 19 Sep 2017 12:44:59 +0200 Subject: [PATCH] Fix compile with bad strrchr signature --- src/common/utility.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/utility.cpp b/src/common/utility.cpp index 53aaf2b9d..460435f1d 100644 --- a/src/common/utility.cpp +++ b/src/common/utility.cpp @@ -46,6 +46,7 @@ #include #include +#include #if defined(Q_OS_WIN) #include "utility_win.cpp" @@ -547,28 +548,28 @@ QUrl Utility::concatUrlPath(const QUrl &url, const QString &concatPath, bool Utility::isConflictFile(const char *name) { - auto bname = strrchr(name, '/'); + const char *bname = std::strrchr(name, '/'); if (bname) { bname += 1; } else { bname = name; } - if (strstr(bname, "_conflict-")) + if (std::strstr(bname, "_conflict-")) return true; if (shouldUploadConflictFiles()) { // For uploads, we want to consider files with any kind of username tag // as conflict files. (pattern *_conflict_*-) - auto startOfMarker = strstr(bname, "_conflict_"); - if (startOfMarker && strchr(startOfMarker, '-')) + const char *startOfMarker = std::strstr(bname, "_conflict_"); + if (startOfMarker && std::strchr(startOfMarker, '-')) return true; } else { // Old behavior: optionally, files with the specific string in the env variable // appended are also considered conflict files. static auto conflictFileUsername = qgetenv("CSYNC_CONFLICT_FILE_USERNAME"); static auto usernameConflictId = QByteArray("_conflict_" + conflictFileUsername + "-"); - if (!conflictFileUsername.isEmpty() && strstr(bname, usernameConflictId.constData())) { + if (!conflictFileUsername.isEmpty() && std::strstr(bname, usernameConflictId.constData())) { return true; } }