From 5413784c57b02d681e7b02648fab6b2ac4bb4dcb Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:25:08 +0800 Subject: [PATCH] fix miss PATH_MAX --- src/filesystem/path.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/filesystem/path.cc b/src/filesystem/path.cc index a1dcc52..e7607f1 100644 --- a/src/filesystem/path.cc +++ b/src/filesystem/path.cc @@ -3,12 +3,18 @@ #include #include +#ifndef PATH_MAX +#define PATH_MAX_SZ 4096 +#else +#define PATH_MAX_SZ PATH_MAX +#endif + namespace sled { Path Path::Current() { - char tmp_path[PATH_MAX]; - if (getcwd(tmp_path, PATH_MAX)) { + char tmp_path[PATH_MAX_SZ]; + if (getcwd(tmp_path, PATH_MAX_SZ)) { auto cwd = Path(tmp_path); return cwd; }