]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.175 v7.4.175
authorBram Moolenaar <Bram@vim.org>
Tue, 11 Feb 2014 16:06:00 +0000 (17:06 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 11 Feb 2014 16:06:00 +0000 (17:06 +0100)
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)

src/os_mswin.c
src/os_win32.c
src/version.c

index c7eab50d5192fb5f86ad35c2e5bdbd4ab48c7ef1..bf9acdbbf40fd0c657ec8f47feb285159c8f4aba 100644 (file)
@@ -648,7 +648,7 @@ vim_stat(const char *name, struct stat *stp)
        {
            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 @@ mch_chdir(char *path)
        {
            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 @@ mch_resolve_shortcut(char_u *fname)
 
 shortcut_errorw:
                vim_free(p);
-               if (hr == S_OK)
-                   goto shortcut_end;
+               goto shortcut_end;
            }
        }
        /* Retry with non-wide function (for Windows 98). */
index a468bbe745417b118385569d7b63d9b55ae19040..c23b791ae7cbd47a5d699ac0ae061aadb7d5e056 100644 (file)
@@ -2877,6 +2877,8 @@ mch_get_user_name(
                return OK;
            }
        }
+       else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+           return FAIL;
        /* Retry with non-wide function (for Windows 98). */
     }
 #endif
@@ -2917,6 +2919,8 @@ mch_get_host_name(
                return;
            }
        }
+       else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+           return;
        /* Retry with non-wide function (for Windows 98). */
     }
 #endif
@@ -2966,6 +2970,8 @@ mch_dirname(
                return OK;
            }
        }
+       else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+           return FAIL;
        /* Retry with non-wide function (for Windows 98). */
     }
 #endif
@@ -3006,7 +3012,7 @@ mch_setperm(char_u *name, long perm)
        {
            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 @@ mch_open(char *name, int flags, int mode)
        {
            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 @@ mch_fopen(char *name, char *mode)
        _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
index dfecc7c9f7a45f833481be4584e9f67a64dd6996..5fdb9242589407434ed8b834e7eb61fa35ab273a 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    175,
 /**/
     174,
 /**/