Skip to content

Commit

Permalink
[cling] Do not skip hidden directories:
Browse files Browse the repository at this point in the history
path elements starting with "." should not be ignored, only "./" itself.
Fixes issue #9697.

(cherry picked from commit 37a396c)
  • Loading branch information
Axel-Naumann committed Mar 8, 2022
1 parent e642bf9 commit 6802514
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,13 @@ std::string cached_realpath(llvm::StringRef path, llvm::StringRef base_path = ""

// Handle path list items
for (auto item : p) {
if (item.startswith(".")) {
if (item == "..") {
size_t s = result.rfind(sep);
if (s != llvm::StringRef::npos) result.resize(s);
if (result.empty()) result = sep;
}
continue;
} else if (item == "~") {
continue;
if (item == ".")
continue; // skip "." element in "abc/./def"
if (item == "..") {
// collapse "a/b/../c" to "a/c"
size_t s = result.rfind(sep);
if (s != llvm::StringRef::npos) result.resize(s);
if (result.empty()) result = sep;
}

size_t old_size = result.size();
Expand Down

0 comments on commit 6802514

Please sign in to comment.