From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Wed, 15 Sep 2021 00:02:36 +0900
Subject: Use getcwd(3) POSIX extension to avoid PATH_MAX macro

Forwarded: not-needed

This fix helps GNU Hurd.
---
 CPP/Windows/FileDir.cpp | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/CPP/Windows/FileDir.cpp b/CPP/Windows/FileDir.cpp
index 5e95204..9b5394e 100755
--- a/CPP/Windows/FileDir.cpp
+++ b/CPP/Windows/FileDir.cpp
@@ -906,22 +906,11 @@ bool GetCurrentDir(FString &path)
 {
   path.Empty();
 
-  #define MY__PATH_MAX  PATH_MAX
-  // #define MY__PATH_MAX  1024
-
-  char s[MY__PATH_MAX + 1];
-  char *res = getcwd(s, MY__PATH_MAX);
-  if (res)
-  {
-    path = fas2fs(s);
-    return true;
-  }
   {
-    // if (errno != ERANGE) return false;
     #if defined(__GLIBC__) || defined(__APPLE__)
     /* As an extension to the POSIX.1-2001 standard, glibc's getcwd()
        allocates the buffer dynamically using malloc(3) if buf is NULL. */
-    res = getcwd(NULL, 0);
+    char *res = getcwd(NULL, 0);
     if (res)
     {
       path = fas2fs(res);
