Fix replacement
This commit is contained in:
@@ -29,6 +29,7 @@ public:
|
||||
while(!is.eof())
|
||||
{
|
||||
std::getline(is, tmp);
|
||||
std::cout << tmp << std::endl;
|
||||
if (tmp.at(0) == '#') // ignore comments
|
||||
continue;
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
#include "usermanager.h"
|
||||
#include "configfilemanager.h"
|
||||
|
||||
configfilemanager cfm;
|
||||
userManager manager;
|
||||
std::condition_variable cv;
|
||||
std::mutex mtx;
|
||||
configfilemanager cfm;
|
||||
|
||||
std::vector<std::string> splitString(const std::string& str, char delimiter = '|')
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ std::string userManager::getScanCommandFromUser(const std::string &user, configf
|
||||
std::string contname = cfm.at("NEXTCLOUD_CONTAINER_NAME");
|
||||
std::string baseCommand;
|
||||
std::string userCommand;
|
||||
std::string placeholder("%1%");
|
||||
|
||||
if (user.find("__groupfolder") != std::string::npos)
|
||||
{
|
||||
@@ -18,8 +19,8 @@ std::string userManager::getScanCommandFromUser(const std::string &user, configf
|
||||
}
|
||||
|
||||
size_t pos = 0;
|
||||
while ((pos = baseCommand.find("%1%", pos)) != std::string::npos) {
|
||||
baseCommand.replace(pos, contname.length(), contname);
|
||||
while ((pos = baseCommand.find(placeholder, pos)) != std::string::npos) {
|
||||
baseCommand.replace(pos, placeholder.length(), contname);
|
||||
pos += contname.length(); // Move past the replacement
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user