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:
James McCoy 2018-12-30 09:01:59 -05:00
parent d442345729
commit 1e06c235b8
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -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);