Skip to content

Commit a9f8ee0

Browse files
committed
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 #1973)
1 parent 60104f1 commit a9f8ee0

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,10 +2473,10 @@ command_line_scan(mparm_T *parmp)
24732473
*/
24742474
if (vim_strpbrk(p, "\\:") != NULL && !path_with_url(p))
24752475
{
2476-
char posix_path[PATH_MAX];
2476+
char posix_path[MAXPATHL];
24772477

24782478
# if CYGWIN_VERSION_DLL_MAJOR >= 1007
2479-
cygwin_conv_path(CCP_WIN_A_TO_POSIX, p, posix_path, PATH_MAX);
2479+
cygwin_conv_path(CCP_WIN_A_TO_POSIX, p, posix_path, MAXPATHL);
24802480
# else
24812481
cygwin_conv_to_posix_path(p, posix_path);
24822482
# endif
@@ -3598,10 +3598,10 @@ set_progpath(char_u *argv0)
35983598
char_u *val = argv0;
35993599

36003600
# ifdef PROC_EXE_LINK
3601-
char buf[PATH_MAX + 1];
3601+
char buf[MAXPATHL + 1];
36023602
ssize_t len;
36033603

3604-
len = readlink(PROC_EXE_LINK, buf, PATH_MAX);
3604+
len = readlink(PROC_EXE_LINK, buf, MAXPATHL);
36053605
if (len > 0)
36063606
{
36073607
buf[len] = NUL;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
946,
772774
/**/
773775
945,
774776
/**/

0 commit comments

Comments
 (0)