Last active
August 29, 2015 14:09
-
-
Save Shougo/1a7d7a53a7c56ca48a85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 36bb83cc6202 src/edit.c | |
--- a/src/edit.c Sat Nov 15 08:13:55 2014 +0900 | |
+++ b/src/edit.c Sat Nov 15 08:46:02 2014 +0900 | |
@@ -2505,6 +2505,10 @@ | |
return FAIL; | |
if (len < 0) | |
len = (int)STRLEN(str); | |
+ if (compl_first_match != NULL | |
+ && STRNCMP(compl_first_match->cp_str, str, len) == 0 | |
+ && compl_first_match->cp_str[len] == NUL) | |
+ return FAIL; | |
/* | |
* If the same match is already present, don't add it. | |
@@ -2611,6 +2615,8 @@ | |
char_u *str; | |
int len; | |
{ | |
+ if (STRLEN(match->cp_str) <= (size_t)len) | |
+ return FALSE; | |
if (match->cp_icase) | |
return STRNICMP(match->cp_str, str, (size_t)len) == 0; | |
return STRNCMP(match->cp_str, str, (size_t)len) == 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment