Skip to content

Commit c35662a

Browse files
committed
Merge pull request #31 from aafemt/CORE-5223
Postfix for CORE-5223: root is lost on POSIX
2 parents 0fbd406 + af81c6b commit c35662a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/common/config/dir_list.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ void ParsedPath::parse(const PathName& path)
4242
PathUtils::splitLastComponent(newpath, elem, oldpath);
4343
oldpath = newpath;
4444

45-
if (elem.isEmpty() && !oldpath.isEmpty()) // Skip double dir separator
45+
if (elem.isEmpty()) // Skip double dir separator
46+
{
4647
continue;
4748

4849
if (elem == PathUtils::curr_dir_link) // Skip current dir reference
@@ -72,12 +73,12 @@ void ParsedPath::parse(const PathName& path)
7273

7374
PathName ParsedPath::subPath(FB_SIZE_T n) const
7475
{
75-
PathName rc = (*this)[0];
76-
77-
if (rc.isEmpty())
78-
rc = PathUtils::dir_sep;
79-
80-
for (FB_SIZE_T i = 1; i < n; i++)
76+
PathName rc;
77+
#ifndef WIN_NT
78+
// Code in DirectoryList::initialize() ensured that the path is absolute
79+
rc = PathUtils::dir_sep;
80+
#endif
81+
for (FB_SIZE_T i = 0; i < n; i++)
8182
{
8283
PathName newpath;
8384
PathUtils::concatPath(newpath, rc, (*this)[i]);

0 commit comments

Comments
 (0)