File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Top Open diff view settings Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Top Open diff view settings Original file line number Diff line number Diff line change @@ -994,15 +994,15 @@ int os_self_exe_path(Buf *out_path) {
994994 int ret1 = _NSGetExecutablePath (nullptr , &u32_len);
995995 assert (ret1 != 0 );
996996
997- // Make a buffer having room for the temp path.
998997 Buf *tmp = buf_alloc_fixed (u32_len);
999998
1000999 // Fill the executable path.
10011000 int ret2 = _NSGetExecutablePath (buf_ptr (tmp), &u32_len);
10021001 assert (ret2 == 0 );
10031002
1004- // Resolve the real path from that.
1005- buf_resize (out_path, PATH_MAX);
1003+ // According to libuv project, PATH_MAX*2 works around a libc bug where
1004+ // the resolved path is sometimes bigger than PATH_MAX.
1005+ buf_resize (out_path, PATH_MAX*2 );
10061006 char *real_path = realpath (buf_ptr (tmp), buf_ptr (out_path));
10071007 if (!real_path) {
10081008 buf_init_from_buf (out_path, tmp);
You can’t perform that action at this time.
0 commit comments