Skip to content

Commit a2c8863

Browse files
committed
Revert "Add support for FS_LAYER_TYPE_SAVE_REPLACE_IGNORE_VOL_SAVE_COMMON"
This reverts commit 71406e2.
1 parent 0d5bf8c commit a2c8863

3 files changed

Lines changed: 2 additions & 19 deletions

File tree

src/FSWrapper.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -670,15 +670,7 @@ bool FSWrapper::IsFileModeAllowed(const char *mode) {
670670
}
671671

672672
bool FSWrapper::IsPathToReplace(const std::string_view &path) {
673-
if (!path.starts_with(pPathToReplace)) {
674-
return false;
675-
}
676-
677-
if (std::ranges::any_of(pIgnorePaths.cbegin(), pIgnorePaths.cend(), [&path](auto &ignorePath) { return path.starts_with(ignorePath); })) {
678-
return false;
679-
}
680-
681-
return true;
673+
return path.starts_with(pPathToReplace);
682674
}
683675

684676
std::string FSWrapper::GetNewPath(const std::string_view &path) {

src/FSWrapper.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,16 @@
1010

1111
class FSWrapper : public IFSWrapper {
1212
public:
13-
FSWrapper(const std::string &name, const std::string &pathToReplace, const std::string &replacePathWith, bool fallbackOnError, bool isWriteable, std::vector<std::string> ignorePaths = {}) {
13+
FSWrapper(const std::string &name, const std::string &pathToReplace, const std::string &replacePathWith, bool fallbackOnError, bool isWriteable) {
1414
this->pName = name;
1515
this->pPathToReplace = pathToReplace;
1616
this->pReplacePathWith = replacePathWith;
1717
this->pFallbackOnError = fallbackOnError;
1818
this->pIsWriteable = isWriteable;
1919
this->pCheckIfDeleted = fallbackOnError;
20-
this->pIgnorePaths = std::move(ignorePaths);
2120

2221
std::replace(pPathToReplace.begin(), pPathToReplace.end(), '\\', '/');
2322
std::replace(pReplacePathWith.begin(), pReplacePathWith.end(), '\\', '/');
24-
for (auto &ignorePath : pIgnorePaths) {
25-
std::replace(ignorePath.begin(), ignorePath.end(), '\\', '/');
26-
}
2723
}
2824
~FSWrapper() override {
2925
{
@@ -133,7 +129,6 @@ class FSWrapper : public IFSWrapper {
133129
private:
134130
std::string pPathToReplace;
135131
std::string pReplacePathWith;
136-
std::vector<std::string> pIgnorePaths;
137132
bool pIsWriteable = false;
138133
std::mutex openFilesMutex;
139134
std::mutex openDirsMutex;

src/export.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ ContentRedirectionApiErrorType CRAddFSLayer(CRLayerHandle *handle, const char *l
115115
} else if (layerType == FS_LAYER_TYPE_SAVE_REPLACE) {
116116
DEBUG_FUNCTION_LINE_INFO("Redirecting \"/vol/save\" to \"%s\", mode: \"replace\"", replacementDir);
117117
ptr = make_unique_nothrow<FSWrapper>(layerName, "/vol/save", replacementDir, false, true);
118-
} else if (layerType == FS_LAYER_TYPE_SAVE_REPLACE_IGNORE_VOL_SAVE_COMMON) {
119-
DEBUG_FUNCTION_LINE_INFO("Redirecting \"/vol/save\" to \"%s\", mode: \"replace\", ignore: (\"/vol/save/common\")", replacementDir);
120-
std::vector<std::string> ignorePaths({"/vol/save/common"});
121-
ptr = make_unique_nothrow<FSWrapper>(layerName, "/vol/save", replacementDir, false, true, ignorePaths);
122118
} else {
123119
DEBUG_FUNCTION_LINE_ERR("CONTENT_REDIRECTION_API_ERROR_UNKNOWN_LAYER_DIR_TYPE: %s %s %d", layerName, replacementDir, layerType);
124120
return CONTENT_REDIRECTION_API_ERROR_UNKNOWN_FS_LAYER_TYPE;

0 commit comments

Comments
 (0)