Fix replacement
This commit is contained in:
@@ -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