mirror of
https://github.com/wiiu-env/ContentRedirectionModule.git
synced 2024-11-13 07:05:14 +01:00
Fallback to "/" when no CWD for a given client was found
This commit is contained in:
parent
3e7b9b3fef
commit
897bc37ae4
@ -21,11 +21,11 @@ std::string getFullPathForFSClient(FSClient *pClient, const char *path) {
|
||||
std::string res;
|
||||
|
||||
if (path[0] != '/' && path[0] != '\\') {
|
||||
if (workingDirsFS.count(pClient) > 0) {
|
||||
res = string_format("%s%s", workingDirsFS.at(pClient).c_str(), path);
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE_ERR("Failed to find working dir for client");
|
||||
if (workingDirsFS.count(pClient) == 0) {
|
||||
DEBUG_FUNCTION_LINE_WARN("No working dir found for FS client %08X, fallback to \"/\"", pClient);
|
||||
workingDirsFS[pClient] = "/";
|
||||
}
|
||||
res = string_format("%s%s", workingDirsFS.at(pClient).c_str(), path);
|
||||
} else {
|
||||
res = path;
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ extern "C" {
|
||||
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) LOG(WHBLogWritef, FMT, ##ARGS)
|
||||
|
||||
#define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) LOG_EX_DEFAULT(WHBLogPrintf, "##ERROR## ", "", FMT, ##ARGS)
|
||||
#define DEBUG_FUNCTION_LINE_WARN(FMT, ARGS...) LOG_EX_DEFAULT(WHBLogPrintf, "##WARN ## ", "", FMT, ##ARGS)
|
||||
|
||||
#define DEBUG_FUNCTION_LINE_ERR_LAMBDA(FILENAME, FUNCTION, LINE, FMT, ARGS...) LOG_EX(FILENAME, FUNCTION, LINE, WHBLogPrintf, "##ERROR## ", "", FMT, ##ARGS);
|
||||
|
||||
@ -52,6 +53,7 @@ extern "C" {
|
||||
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) while (0)
|
||||
|
||||
#define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) LOG_EX_DEFAULT(OSReport, "##ERROR## ", "\n", FMT, ##ARGS)
|
||||
#define DEBUG_FUNCTION_LINE_WARN(FMT, ARGS...) LOG_EX_DEFAULT(OSReport, "##WARN ## ", "\n", FMT, ##ARGS)
|
||||
|
||||
#define DEBUG_FUNCTION_LINE_ERR_LAMBDA(FILENAME, FUNCTION, LINE, FMT, ARGS...) LOG_EX(FILENAME, FUNCTION, LINE, OSReport, "##ERROR## ", "\n", FMT, ##ARGS);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user