summaryrefslogtreecommitdiff
path: root/test/interactive-helper/aptwebserver.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/interactive-helper/aptwebserver.cc')
-rw-r--r--test/interactive-helper/aptwebserver.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 5da715253..109364d7a 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -747,9 +747,16 @@ static void * handleClient(int const client, size_t const id) /*{{{*/
}
if (regexec(pattern, filename.c_str(), 0, 0, 0) == 0)
{
- filename = _config->Find("aptwebserver::overwrite::" + I->Tag + "::filename", filename);
- if (filename[0] == '/')
+ filename = _config->Find("aptwebserver::overwrite::" + I->Tag + "::filename", flNotDir(filename));
+ if (filename.find("/") == std::string::npos)
+ {
+ auto directory = _config->Find("aptwebserver::overwrite::" + I->Tag + "::directory", flNotFile(filename));
+ filename = flCombine(directory, filename);
+ }
+ if (filename.empty() == false && filename[0] == '/')
filename.erase(0,1);
+ if (filename.empty())
+ filename = "./";
regfree(pattern);
break;
}