diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-10-13 20:37:41 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-10-13 20:37:41 +0200 |
commit | 464c92545ac15ebb481d3fde683d6b147a527814 (patch) | |
tree | fbf8456f1257f344906beb1b184c816600ce062c /src | |
parent | 77a0aa457d66d6dd06435bdd2dd9d53e704e1373 (diff) | |
download | vim-464c92545ac15ebb481d3fde683d6b147a527814.zip |
updated for version 7.3.027
Problem: Opening a file on a network share is very slow.
Solution: When fixing file name case append "\*" to directory, server and
network share names. (David Anderson, John Beckett)
Diffstat (limited to 'src')
-rw-r--r-- | src/os_win32.c | 11 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/os_win32.c b/src/os_win32.c index 8c59e0996..6bfcc2af5 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -2308,12 +2308,14 @@ fname_case( int len) { char szTrueName[_MAX_PATH + 2]; + char szTrueNameTemp[_MAX_PATH + 2]; char *ptrue, *ptruePrev; char *porig, *porigPrev; int flen; WIN32_FIND_DATA fb; HANDLE hFind; int c; + int slen; flen = (int)STRLEN(name); if (flen == 0 || flen > _MAX_PATH) @@ -2358,12 +2360,19 @@ fname_case( } *ptrue = NUL; + /* To avoid a slow failure append "\*" when searching a directory, + * server or network share. */ + STRCPY(szTrueNameTemp, szTrueName); + slen = strlen(szTrueNameTemp); + if (*porig == psepc && slen + 2 < _MAX_PATH) + STRCPY(szTrueNameTemp + slen, "\\*"); + /* Skip "", "." and "..". */ if (ptrue > ptruePrev && (ptruePrev[0] != '.' || (ptruePrev[1] != NUL && (ptruePrev[1] != '.' || ptruePrev[2] != NUL))) - && (hFind = FindFirstFile(szTrueName, &fb)) + && (hFind = FindFirstFile(szTrueNameTemp, &fb)) != INVALID_HANDLE_VALUE) { c = *porig; diff --git a/src/version.c b/src/version.c index bedc601c8..dde80faee 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 27, +/**/ 26, /**/ 25, |