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
index c7eab50..bf9acdb 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -648,7 +648,7 @@
{
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
@@ -815,8 +815,8 @@
{
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). */
}
}
@@ -1942,8 +1942,7 @@
shortcut_errorw:
vim_free(p);
- if (hr == S_OK)
- goto shortcut_end;
+ goto shortcut_end;
}
}
/* Retry with non-wide function (for Windows 98). */
diff --git a/src/os_win32.c b/src/os_win32.c
index a468bbe..c23b791 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2877,6 +2877,8 @@
return OK;
}
}
+ else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return FAIL;
/* Retry with non-wide function (for Windows 98). */
}
#endif
@@ -2917,6 +2919,8 @@
return;
}
}
+ else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return;
/* Retry with non-wide function (for Windows 98). */
}
#endif
@@ -2966,6 +2970,8 @@
return OK;
}
}
+ else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return FAIL;
/* Retry with non-wide function (for Windows 98). */
}
#endif
@@ -3006,7 +3012,7 @@
{
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). */
}
@@ -6048,7 +6054,7 @@
{
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
@@ -6099,7 +6105,7 @@
_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
diff --git a/src/version.c b/src/version.c
index dfecc7c..5fdb924 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 175,
+/**/
174,
/**/
173,