aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2018-12-30 09:01:59 -0500
committerJames McCoy <jamessan@jamessan.com>2018-12-30 09:02:35 -0500
commit1e06c235b81089a0127aea278643e8d236168002 (patch)
tree49e9543e293d159a165af201f0576ed8f0d507d4 /src
parentd442345729a497663b32ee0609c6b697567a4e10 (diff)
downloadrneovim-1e06c235b81089a0127aea278643e8d236168002.tar.gz
rneovim-1e06c235b81089a0127aea278643e8d236168002.tar.bz2
rneovim-1e06c235b81089a0127aea278643e8d236168002.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/env.c2
1 files changed, 1 insertions, 1 deletions
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);