From 1e06c235b81089a0127aea278643e8d236168002 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 30 Dec 2018 09:01:59 -0500 Subject: vim-patch:8.1.0662: needlessly searching for tilde in string Problem: Needlessly searching for tilde in string. Solution: Only check the first character. (James McCoy, closes vim/vim#3734) https://github.com/vim/vim/commit/ef0a1d5ed3566b91143d30ae9de3240f47c6e282 --- src/nvim/os/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 2f90d0bc9e..eb4ea45ec1 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -779,7 +779,7 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char *homedir_env_mod = (char *)homedir_env; bool must_free = false; - if (homedir_env_mod != NULL && strchr(homedir_env_mod, '~') != NULL) { + if (homedir_env_mod != NULL && *homedir_env_mod == '~') { must_free = true; size_t usedlen = 0; size_t flen = strlen(homedir_env_mod); -- cgit