0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 7.4.1651

Problem:    Some dead (MSDOS) code remains.
Solution:   Remove the unused lines. (Ken Takata)
This commit is contained in:
Bram Moolenaar
2016-03-25 17:21:19 +01:00
parent f68f1d7079
commit 780d4c3fff
2 changed files with 4 additions and 43 deletions

View File

@@ -9737,18 +9737,6 @@ pstrcmp(const void *a, const void *b)
return (pathcmp(*(char **)a, *(char **)b, -1)); return (pathcmp(*(char **)a, *(char **)b, -1));
} }
# ifndef WIN3264
static void
namelowcpy(
char_u *d,
char_u *s)
{
while (*s)
*d++ = TOLOWER_LOC(*s++);
*d = NUL;
}
# endif
/* /*
* Recursively expand one path component into all matching files and/or * Recursively expand one path component into all matching files and/or
* directories. Adds matches to "gap". Handles "*", "?", "[a-z]", "**", etc. * directories. Adds matches to "gap". Handles "*", "?", "[a-z]", "**", etc.
@@ -9777,16 +9765,12 @@ dos_expandpath(
int len; int len;
int starstar = FALSE; int starstar = FALSE;
static int stardepth = 0; /* depth for "**" expansion */ static int stardepth = 0; /* depth for "**" expansion */
#ifdef WIN3264
WIN32_FIND_DATA fb; WIN32_FIND_DATA fb;
HANDLE hFind = (HANDLE)0; HANDLE hFind = (HANDLE)0;
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
WIN32_FIND_DATAW wfb; WIN32_FIND_DATAW wfb;
WCHAR *wn = NULL; /* UCS-2 name, NULL when not used. */ WCHAR *wn = NULL; /* UCS-2 name, NULL when not used. */
# endif # endif
#else
struct ffblk fb;
#endif
char_u *matchname; char_u *matchname;
int ok; int ok;
@@ -9827,7 +9811,7 @@ dos_expandpath(
else if (path_end >= path + wildoff else if (path_end >= path + wildoff
&& vim_strchr((char_u *)"*?[~", *path_end) != NULL) && vim_strchr((char_u *)"*?[~", *path_end) != NULL)
e = p; e = p;
#ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
if (has_mbyte) if (has_mbyte)
{ {
len = (*mb_ptr2len)(path_end); len = (*mb_ptr2len)(path_end);
@@ -9836,7 +9820,7 @@ dos_expandpath(
path_end += len; path_end += len;
} }
else else
#endif # endif
*p++ = *path_end++; *p++ = *path_end++;
} }
e = p; e = p;
@@ -9897,7 +9881,6 @@ dos_expandpath(
/* Scan all files in the directory with "dir/ *.*" */ /* Scan all files in the directory with "dir/ *.*" */
STRCPY(s, "*.*"); STRCPY(s, "*.*");
#ifdef WIN3264
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{ {
@@ -9921,24 +9904,15 @@ dos_expandpath(
# endif # endif
hFind = FindFirstFile((LPCSTR)buf, &fb); hFind = FindFirstFile((LPCSTR)buf, &fb);
ok = (hFind != INVALID_HANDLE_VALUE); ok = (hFind != INVALID_HANDLE_VALUE);
#else
/* If we are expanding wildcards we try both files and directories */
ok = (findfirst((char *)buf, &fb,
(*path_end != NUL || (flags & EW_DIR)) ? FA_DIREC : 0) == 0);
#endif
while (ok) while (ok)
{ {
#ifdef WIN3264
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
if (wn != NULL) if (wn != NULL)
p = utf16_to_enc(wfb.cFileName, NULL); /* p is allocated here */ p = utf16_to_enc(wfb.cFileName, NULL); /* p is allocated here */
else else
# endif # endif
p = (char_u *)fb.cFileName; p = (char_u *)fb.cFileName;
#else
p = (char_u *)fb.ff_name;
#endif
/* Ignore entries starting with a dot, unless when asked for. Accept /* Ignore entries starting with a dot, unless when asked for. Accept
* all entries found with "matchname". */ * all entries found with "matchname". */
if ((p[0] != '.' || starts_with_dot if ((p[0] != '.' || starts_with_dot
@@ -9950,11 +9924,7 @@ dos_expandpath(
|| ((flags & EW_NOTWILD) || ((flags & EW_NOTWILD)
&& fnamencmp(path + (s - buf), p, e - s) == 0))) && fnamencmp(path + (s - buf), p, e - s) == 0)))
{ {
#ifdef WIN3264
STRCPY(s, p); STRCPY(s, p);
#else
namelowcpy(s, p);
#endif
len = (int)STRLEN(buf); len = (int)STRLEN(buf);
if (starstar && stardepth < 100) if (starstar && stardepth < 100)
@@ -9986,7 +9956,6 @@ dos_expandpath(
} }
} }
#ifdef WIN3264
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
if (wn != NULL) if (wn != NULL)
{ {
@@ -9996,16 +9965,12 @@ dos_expandpath(
else else
# endif # endif
ok = FindNextFile(hFind, &fb); ok = FindNextFile(hFind, &fb);
#else
ok = (findnext(&fb) == 0);
#endif
/* If no more matches and no match was used, try expanding the name /* If no more matches and no match was used, try expanding the name
* itself. Finds the long name of a short filename. */ * itself. Finds the long name of a short filename. */
if (!ok && matchname != NULL && gap->ga_len == start_len) if (!ok && matchname != NULL && gap->ga_len == start_len)
{ {
STRCPY(s, matchname); STRCPY(s, matchname);
#ifdef WIN3264
FindClose(hFind); FindClose(hFind);
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
if (wn != NULL) if (wn != NULL)
@@ -10019,21 +9984,15 @@ dos_expandpath(
# endif # endif
hFind = FindFirstFile((LPCSTR)buf, &fb); hFind = FindFirstFile((LPCSTR)buf, &fb);
ok = (hFind != INVALID_HANDLE_VALUE); ok = (hFind != INVALID_HANDLE_VALUE);
#else
ok = (findfirst((char *)buf, &fb,
(*path_end != NUL || (flags & EW_DIR)) ? FA_DIREC : 0) == 0);
#endif
vim_free(matchname); vim_free(matchname);
matchname = NULL; matchname = NULL;
} }
} }
#ifdef WIN3264
FindClose(hFind); FindClose(hFind);
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
vim_free(wn); vim_free(wn);
# endif # endif
#endif
vim_free(buf); vim_free(buf);
vim_regfree(regmatch.regprog); vim_regfree(regmatch.regprog);
vim_free(matchname); vim_free(matchname);

View File

@@ -748,6 +748,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1651,
/**/ /**/
1650, 1650,
/**/ /**/