For some reason I didn't get the email about patch 7.4.175, and it is
not in my Gmail spam folder either.
Not a big deal since the corresponding Mercurial changeset was
downloaded in time, so I can produce an equivalent patch with the help
of hg diff (attached). Note that the changeset in the first line of what
the patch manual calls the "leading garbage" (the hg log entry) has the
correct changeset ID (in hex) but an arbitrary ordinal (in decimal).
According to ftp://ftp.vim.org/pub/vim/patches/7.4/README its summary
is: 5133 7.4.175 wrong fall-back to non-wide function if wide
function fails
Best regards,
Tony.
--
Genius is one percent inspiration and ninety-nine percent perspiration.
-- Thomas Alva Edison
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
changeset: 6178:6b69d8dde19e
tag: v7-4-175
user: Bram Moolenaar <[email protected]>
date: Tue Feb 11 17:06:00 2014 +0100
files: src/os_mswin.c src/os_win32.c src/version.c
description:
updated for version 7.4.175
Problem: When a wide library function fails, falling back to the non-wide
function may do the wrong thing.
Solution: Check the platform, when the wide function is supported don't fall
back to the non-wide function. (Ken Takata)
diff --git a/src/os_mswin.c b/src/os_mswin.c
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -643,17 +643,17 @@ vim_stat(const char *name, struct stat *
{
WCHAR *wp = enc_to_utf16(buf, NULL);
int n;
if (wp != NULL)
{
n = wstat_symlink_aware(wp, (struct _stat *)stp);
vim_free(wp);
- if (n >= 0)
+ if (n >= 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
return n;
/* Retry with non-wide function (for Windows 98). Can't use
* GetLastError() here and it's unclear what errno gets set to if
* the _wstat() fails for missing wide functions. */
}
}
#endif
return stat_symlink_aware(buf, stp);
@@ -810,18 +810,18 @@ mch_chdir(char *path)
{
WCHAR *p = enc_to_utf16(path, NULL);
int n;
if (p != NULL)
{
n = _wchdir(p);
vim_free(p);
- if (n == 0)
- return 0;
+ if (n == 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
+ return n;
/* Retry with non-wide function (for Windows 98). */
}
}
#endif
return chdir(path); /* let the normal chdir() do the rest */
}
@@ -1937,18 +1937,17 @@ mch_resolve_shortcut(char_u *fname)
// Get the path to the link target.
ZeroMemory(wsz, MAX_PATH * sizeof(WCHAR));
hr = pslw->lpVtbl->GetPath(pslw, wsz, MAX_PATH, &ffdw, 0);
if (hr == S_OK && wsz[0] != NUL)
rfname = utf16_to_enc(wsz, NULL);
shortcut_errorw:
vim_free(p);
- if (hr == S_OK)
- goto shortcut_end;
+ goto shortcut_end;
}
}
/* Retry with non-wide function (for Windows 98). */
}
# endif
// create a link manager object and request its interface
hr = CoCreateInstance(
&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
diff --git a/src/os_win32.c b/src/os_win32.c
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2872,16 +2872,18 @@ mch_get_user_name(
if (p != NULL)
{
vim_strncpy(s, p, len - 1);
vim_free(p);
return OK;
}
}
+ else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return FAIL;
/* Retry with non-wide function (for Windows 98). */
}
#endif
if (GetUserName(szUserName, &cch))
{
vim_strncpy(s, szUserName, len - 1);
return OK;
}
@@ -2912,16 +2914,18 @@ mch_get_host_name(
if (p != NULL)
{
vim_strncpy(s, p, len - 1);
vim_free(p);
return;
}
}
+ else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return;
/* Retry with non-wide function (for Windows 98). */
}
#endif
if (!GetComputerName(s, &cch))
vim_strncpy(s, "PC (Win32 Vim)", len - 1);
}
@@ -2961,16 +2965,18 @@ mch_dirname(
if (p != NULL)
{
vim_strncpy(buf, p, len - 1);
vim_free(p);
return OK;
}
}
+ else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return FAIL;
/* Retry with non-wide function (for Windows 98). */
}
#endif
return (GetCurrentDirectory(len, buf) != 0 ? OK : FAIL);
}
/*
* Get file permissions for "name".
@@ -3001,17 +3007,17 @@ mch_setperm(char_u *name, long perm)
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
WCHAR *p = enc_to_utf16(name, NULL);
if (p != NULL)
{
n = _wchmod(p, perm);
vim_free(p);
- if (n == -1 && GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ if (n == -1 && g_PlatformId == VER_PLATFORM_WIN32_NT)
return FAIL;
/* Retry with non-wide function (for Windows 98). */
}
}
if (n == -1)
#endif
n = _chmod(name, perm);
if (n == -1)
@@ -6043,17 +6049,17 @@ mch_open(char *name, int flags, int mode
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
{
wn = enc_to_utf16(name, NULL);
if (wn != NULL)
{
f = _wopen(wn, flags, mode);
vim_free(wn);
- if (f >= 0)
+ if (f >= 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
return f;
/* Retry with non-wide function (for Windows 98). Can't use
* GetLastError() here and it's unclear what errno gets set to if
* the _wopen() fails for missing wide functions. */
}
}
# endif
@@ -6094,17 +6100,17 @@ mch_fopen(char *name, char *mode)
f = _wfopen(wn, wm);
vim_free(wn);
vim_free(wm);
# if defined(DEBUG) && _MSC_VER >= 1400
_set_fmode(oldMode);
# endif
- if (f != NULL)
+ if (f != NULL || g_PlatformId == VER_PLATFORM_WIN32_NT)
return f;
/* Retry with non-wide function (for Windows 98). Can't use
* GetLastError() here and it's unclear what errno gets set to if
* the _wfopen() fails for missing wide functions. */
}
return fopen(name, mode);
}
diff --git a/src/version.c b/src/version.c
--- a/src/version.c
+++ b/src/version.c
@@ -734,16 +734,18 @@ static char *(features[]) =
# endif
#endif
NULL
};
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 175,
+/**/
174,
/**/
173,
/**/
172,
/**/
171,
/**/