mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 23:17:13 +03:00
Fix compile with bad strrchr signature
This commit is contained in:
parent
2cac928810
commit
6161b5519b
1 changed files with 6 additions and 5 deletions
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
#include "utility_win.cpp"
|
#include "utility_win.cpp"
|
||||||
|
@ -547,28 +548,28 @@ QUrl Utility::concatUrlPath(const QUrl &url, const QString &concatPath,
|
||||||
|
|
||||||
bool Utility::isConflictFile(const char *name)
|
bool Utility::isConflictFile(const char *name)
|
||||||
{
|
{
|
||||||
auto bname = strrchr(name, '/');
|
const char *bname = std::strrchr(name, '/');
|
||||||
if (bname) {
|
if (bname) {
|
||||||
bname += 1;
|
bname += 1;
|
||||||
} else {
|
} else {
|
||||||
bname = name;
|
bname = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(bname, "_conflict-"))
|
if (std::strstr(bname, "_conflict-"))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (shouldUploadConflictFiles()) {
|
if (shouldUploadConflictFiles()) {
|
||||||
// For uploads, we want to consider files with any kind of username tag
|
// For uploads, we want to consider files with any kind of username tag
|
||||||
// as conflict files. (pattern *_conflict_*-)
|
// as conflict files. (pattern *_conflict_*-)
|
||||||
auto startOfMarker = strstr(bname, "_conflict_");
|
const char *startOfMarker = std::strstr(bname, "_conflict_");
|
||||||
if (startOfMarker && strchr(startOfMarker, '-'))
|
if (startOfMarker && std::strchr(startOfMarker, '-'))
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// Old behavior: optionally, files with the specific string in the env variable
|
// Old behavior: optionally, files with the specific string in the env variable
|
||||||
// appended are also considered conflict files.
|
// appended are also considered conflict files.
|
||||||
static auto conflictFileUsername = qgetenv("CSYNC_CONFLICT_FILE_USERNAME");
|
static auto conflictFileUsername = qgetenv("CSYNC_CONFLICT_FILE_USERNAME");
|
||||||
static auto usernameConflictId = QByteArray("_conflict_" + conflictFileUsername + "-");
|
static auto usernameConflictId = QByteArray("_conflict_" + conflictFileUsername + "-");
|
||||||
if (!conflictFileUsername.isEmpty() && strstr(bname, usernameConflictId.constData())) {
|
if (!conflictFileUsername.isEmpty() && std::strstr(bname, usernameConflictId.constData())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue