From aee83b9aa7260a8c66ea010cffd118869180ee94 Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Fri, 4 Nov 2022 16:09:07 +0800 Subject: [PATCH] cleanup: Replace use of getcwd with current_path. --- common/common.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/common.cc b/common/common.cc index 70c2160ff..a7a122313 100644 --- a/common/common.cc +++ b/common/common.cc @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -89,9 +90,7 @@ bool sorbet::FileOps::ensureDir(string_view path) { } std::string sorbet::FileOps::getCurrentDir() { - char buf[MAXPATHLEN + 1]; - getcwd(buf, sizeof(buf)); - return std::string(buf); + return std::filesystem::current_path(); } void sorbet::FileOps::removeDir(string_view path) {