changeset 15308:d7a8f390f6d2 v8.1.0662

patch 8.1.0662: needlessly searching for tilde in string commit https://github.com/vim/vim/commit/ef0a1d5ed3566b91143d30ae9de3240f47c6e282 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 30 11:38:57 2018 +0100 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 https://github.com/vim/vim/issues/3734)
author Bram Moolenaar <Bram@vim.org>
date Sun, 30 Dec 2018 11:45:06 +0100
parents 813102a1eca0
children b048e245e48f
files src/misc1.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -4924,7 +4924,7 @@ home_replace(
 	homedir_env = NULL;
 
 #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL)
-    if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL)
+    if (homedir_env != NULL && *homedir_env == '~')
     {
 	int	usedlen = 0;
 	int	flen;
--- a/src/version.c
+++ b/src/version.c
@@ -800,6 +800,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    662,
+/**/
     661,
 /**/
     660,