Mercurial > vim
diff src/main.c @ 12132:9e5f310b0713 v8.0.0946
patch 8.0.0946: using PATH_MAX does not work well on some systems
commit https://github.com/vim/vim/commit/a9f8ee05f46f2d6621a3719cd15150155d33eed4
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Aug 14 23:40:45 2017 +0200
patch 8.0.0946: using PATH_MAX does not work well on some systems
Problem: Using PATH_MAX does not work well on some systems.
Solution: use MAXPATHL instead. (James McCoy, closes https://github.com/vim/vim/issues/1973)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 14 Aug 2017 23:45:04 +0200 |
parents | 92a86fe8adc0 |
children | 315919a95b4d |
line wrap: on
line diff
--- a/src/main.c +++ b/src/main.c @@ -2473,10 +2473,10 @@ scripterror: */ if (vim_strpbrk(p, "\\:") != NULL && !path_with_url(p)) { - char posix_path[PATH_MAX]; + char posix_path[MAXPATHL]; # if CYGWIN_VERSION_DLL_MAJOR >= 1007 - cygwin_conv_path(CCP_WIN_A_TO_POSIX, p, posix_path, PATH_MAX); + cygwin_conv_path(CCP_WIN_A_TO_POSIX, p, posix_path, MAXPATHL); # else cygwin_conv_to_posix_path(p, posix_path); # endif @@ -3598,10 +3598,10 @@ set_progpath(char_u *argv0) char_u *val = argv0; # ifdef PROC_EXE_LINK - char buf[PATH_MAX + 1]; + char buf[MAXPATHL + 1]; ssize_t len; - len = readlink(PROC_EXE_LINK, buf, PATH_MAX); + len = readlink(PROC_EXE_LINK, buf, MAXPATHL); if (len > 0) { buf[len] = NUL;