[libcxx-commits] [libcxx] [libc++] Make std::filesystem::canonical throw when given empty path (PR #77223)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 7 04:35:31 PST 2024


================
@@ -82,6 +82,8 @@ path __canonical(path const& orig_p, error_code* ec) {
   path cwd;
   ErrorHandler<path> err("canonical", ec, &orig_p, &cwd);
 
+  if (orig_p.empty())
+    return err.report(capture_errno());
----------------
mordante wrote:

I dislike this solution, does not fix the real issue, this part should be fixed in `__do_absolute`. See https://godbolt.org/z/GrvW1KonT

Can you fix `absolute` and `weakly_canonical` too?

https://github.com/llvm/llvm-project/pull/77223


More information about the libcxx-commits mailing list