mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
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)
ef0a1d5ed3
This commit is contained in:
parent
d442345729
commit
1e06c235b8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user