diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-09-08 12:48:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-08 12:48:32 -0700 |
commit | 8a2aec99748229ad9d1e12c1cbc0768d063e8eed (patch) | |
tree | deed001296b252ea886130fea4844a8a7a5d6a7f /src/nvim/runtime.c | |
parent | 3a881132460430d23f2fdc87822c87d47f721cfc (diff) | |
download | rneovim-8a2aec99748229ad9d1e12c1cbc0768d063e8eed.tar.gz rneovim-8a2aec99748229ad9d1e12c1cbc0768d063e8eed.tar.bz2 rneovim-8a2aec99748229ad9d1e12c1cbc0768d063e8eed.zip |
fix(startup): server fails if $NVIM_APPNAME is relative dir #30310
Problem:
If $NVIM_APPNAME is a relative dir path, Nvim fails to start its
primary/default server, and `v:servername` is empty.
Root cause is d34c64e342dfba9248d1055e702d02620a1b31a8, but this wasn't
noticed until 96128a5076b7 started reporting the error more loudly.
Solution:
- `server_address_new`: replace slashes "/" in the appname before using
it as a servername.
- `vim_mktempdir`: always prefer the system-wide top-level "nvim.user/"
directory. That isn't intended to be specific to NVIM_APPNAME; rather,
each *subdirectory* ("nvim.user/xxx") is owned by each Nvim instance.
Nvim "apps" can be identified by the server socket(s) stored in those
per-Nvim subdirs.
fix #30256
Diffstat (limited to 'src/nvim/runtime.c')
-rw-r--r-- | src/nvim/runtime.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 3aa558f305..030bda4fa5 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -1559,7 +1559,7 @@ static inline char *add_env_sep_dirs(char *dest, const char *const val, const ch return dest; } const void *iter = NULL; - const char *appname = get_appname(); + const char *appname = get_appname(false); const size_t appname_len = strlen(appname); do { size_t dir_len; @@ -1626,7 +1626,7 @@ static inline char *add_dir(char *dest, const char *const dir, const size_t dir_ if (!after_pathsep(dest - 1, dest)) { *dest++ = PATHSEP; } - const char *appname = get_appname(); + const char *appname = get_appname(false); size_t appname_len = strlen(appname); assert(appname_len < (IOSIZE - sizeof("-data"))); xmemcpyz(IObuff, appname, appname_len); @@ -1697,7 +1697,7 @@ char *runtimepath_default(bool clean_arg) size_t config_len = 0; size_t vimruntime_len = 0; size_t libdir_len = 0; - const char *appname = get_appname(); + const char *appname = get_appname(false); size_t appname_len = strlen(appname); if (data_home != NULL) { data_len = strlen(data_home); |