mirror of https://gitee.com/bigwinds/arangodb
Bug fix/one more place to do preceding dir char wrong (#10150)
* make sure we don't build paths that start with two \'s * fix condition
This commit is contained in:
parent
823640e8f7
commit
1bbdea4dd4
|
@ -128,7 +128,10 @@ std::string buildFilename(char const* path, char const* name) {
|
||||||
std::string result(path);
|
std::string result(path);
|
||||||
|
|
||||||
if (!result.empty()) {
|
if (!result.empty()) {
|
||||||
result = removeTrailingSeparator(result) + TRI_DIR_SEPARATOR_CHAR;
|
result = removeTrailingSeparator(result);
|
||||||
|
if (result.length() != 1 || result[0] != TRI_DIR_SEPARATOR_CHAR) {
|
||||||
|
result += TRI_DIR_SEPARATOR_CHAR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result.empty() && *name == TRI_DIR_SEPARATOR_CHAR) {
|
if (!result.empty() && *name == TRI_DIR_SEPARATOR_CHAR) {
|
||||||
|
@ -147,7 +150,10 @@ std::string buildFilename(std::string const& path, std::string const& name) {
|
||||||
std::string result(path);
|
std::string result(path);
|
||||||
|
|
||||||
if (!result.empty()) {
|
if (!result.empty()) {
|
||||||
result = removeTrailingSeparator(result) + TRI_DIR_SEPARATOR_CHAR;
|
result = removeTrailingSeparator(result);
|
||||||
|
if (result.length() != 1 || result[0] != TRI_DIR_SEPARATOR_CHAR) {
|
||||||
|
result += TRI_DIR_SEPARATOR_CHAR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result.empty() && !name.empty() && name[0] == TRI_DIR_SEPARATOR_CHAR) {
|
if (!result.empty() && !name.empty() && name[0] == TRI_DIR_SEPARATOR_CHAR) {
|
||||||
|
|
Loading…
Reference in New Issue