[Lldb-commits] [PATCH] D47495: [FileSpec] Re-implmenet removeLastPathComponent

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 30 05:45:59 PDT 2018


JDevlieghere added inline comments.


================
Comment at: unittests/Utility/FileSpecTest.cpp:342
+  EXPECT_FALSE(fs_posix_relative.RemoveLastPathComponent());
+  EXPECT_STREQ("foo", fs_posix_relative.GetCString());
+
----------------
labath wrote:
> Is this the behavior you want here? I was thinking we could fold this all the way to "." (arguably "." is a parent of "foo", though I can see how that may be thought to be too magical)
I like this approach it doesn't consider `.` to be a special case and therefore things are consistent and straightforward. My worry is that if we add special cases, we risk ending up with missing edge cases (like the previous implementation). 


https://reviews.llvm.org/D47495





More information about the lldb-commits mailing list