Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
12131:9741b54f8347 | 12132:9e5f310b0713 |
---|---|
2471 * Look for evidence of non-Cygwin paths before we bother. | 2471 * Look for evidence of non-Cygwin paths before we bother. |
2472 * This is only for when using the Unix files. | 2472 * This is only for when using the Unix files. |
2473 */ | 2473 */ |
2474 if (vim_strpbrk(p, "\\:") != NULL && !path_with_url(p)) | 2474 if (vim_strpbrk(p, "\\:") != NULL && !path_with_url(p)) |
2475 { | 2475 { |
2476 char posix_path[PATH_MAX]; | 2476 char posix_path[MAXPATHL]; |
2477 | 2477 |
2478 # if CYGWIN_VERSION_DLL_MAJOR >= 1007 | 2478 # 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); |
2480 # else | 2480 # else |
2481 cygwin_conv_to_posix_path(p, posix_path); | 2481 cygwin_conv_to_posix_path(p, posix_path); |
2482 # endif | 2482 # endif |
2483 vim_free(p); | 2483 vim_free(p); |
2484 p = vim_strsave((char_u *)posix_path); | 2484 p = vim_strsave((char_u *)posix_path); |
3596 set_progpath(char_u *argv0) | 3596 set_progpath(char_u *argv0) |
3597 { | 3597 { |
3598 char_u *val = argv0; | 3598 char_u *val = argv0; |
3599 | 3599 |
3600 # ifdef PROC_EXE_LINK | 3600 # ifdef PROC_EXE_LINK |
3601 char buf[PATH_MAX + 1]; | 3601 char buf[MAXPATHL + 1]; |
3602 ssize_t len; | 3602 ssize_t len; |
3603 | 3603 |
3604 len = readlink(PROC_EXE_LINK, buf, PATH_MAX); | 3604 len = readlink(PROC_EXE_LINK, buf, MAXPATHL); |
3605 if (len > 0) | 3605 if (len > 0) |
3606 { | 3606 { |
3607 buf[len] = NUL; | 3607 buf[len] = NUL; |
3608 val = (char_u *)buf; | 3608 val = (char_u *)buf; |
3609 } | 3609 } |