diff options
author | Paul Smith <psmith@gnu.org> | 2022-10-22 19:42:07 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-10-22 22:40:26 -0400 |
commit | f364e0d8d6e03f1e8bc995641530e4df6598704c (patch) | |
tree | f7700f2873b0c5b1dd5dffbb741c6f5f3ce43f01 /src/remake.c | |
parent | bb0c05a7f0329dd2ea38021e9c0b9e74e0cdb7de (diff) | |
download | make-git-f364e0d8d6e03f1e8bc995641530e4df6598704c.tar.gz |
Set PATH_MAX on systems without a default value
Some systems (HURD) use fully-dynamic pathnames, with no limit.
We can't support this without significant effort so for now set
PATH_MAX to a large value.
* src/makeint.h: Set PATH_MAX to 4096 if not set and MAXPATHLEN
is also not set. Remove MAXPATHLEN setting: we won't use it.
* src/misc.c (get_path_max): If we can't get the path max via
pathconf() use the default PATH_MAX.
* src/dir.c (find_directory) [W32]: Use MAX_PATH not MAXPATHLEN.
(local_stat) [W32]: Ditto.
* src/job.c (create_batch_file) [W32]: Ditto.
* src/remake.c (name_mtime) [W32]: Ditto.
* src/w32/w32os.c (os_anontmp) [W32]: Ditto.
Diffstat (limited to 'src/remake.c')
-rw-r--r-- | src/remake.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/remake.c b/src/remake.c index 4c87f783..4ce3d2a3 100644 --- a/src/remake.c +++ b/src/remake.c @@ -34,6 +34,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */ #include <starlet.h> #endif #ifdef WINDOWS32 +#include <windows.h> #include <io.h> #include <sys/stat.h> #if defined(_MSC_VER) && _MSC_VER > 1200 @@ -1551,7 +1552,7 @@ name_mtime (const char *name) #if defined(WINDOWS32) { - char tem[MAXPATHLEN], *tstart, *tend; + char tem[MAX_PATH+1], *tstart, *tend; const char *p = name + strlen (name); /* Remove any trailing slashes and "."/"..". MS-Windows stat |