comparison src/os_mswin.c @ 5657:6b69d8dde19e v7.4.175

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)
author Bram Moolenaar <bram@vim.org>
date Tue, 11 Feb 2014 17:06:00 +0100
parents bcf25cc08236
children 22d7af9ff3e5
comparison
equal deleted inserted replaced
5656:5a7b07e0e61e 5657:6b69d8dde19e
646 646
647 if (wp != NULL) 647 if (wp != NULL)
648 { 648 {
649 n = wstat_symlink_aware(wp, (struct _stat *)stp); 649 n = wstat_symlink_aware(wp, (struct _stat *)stp);
650 vim_free(wp); 650 vim_free(wp);
651 if (n >= 0) 651 if (n >= 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
652 return n; 652 return n;
653 /* Retry with non-wide function (for Windows 98). Can't use 653 /* Retry with non-wide function (for Windows 98). Can't use
654 * GetLastError() here and it's unclear what errno gets set to if 654 * GetLastError() here and it's unclear what errno gets set to if
655 * the _wstat() fails for missing wide functions. */ 655 * the _wstat() fails for missing wide functions. */
656 } 656 }
813 813
814 if (p != NULL) 814 if (p != NULL)
815 { 815 {
816 n = _wchdir(p); 816 n = _wchdir(p);
817 vim_free(p); 817 vim_free(p);
818 if (n == 0) 818 if (n == 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
819 return 0; 819 return n;
820 /* Retry with non-wide function (for Windows 98). */ 820 /* Retry with non-wide function (for Windows 98). */
821 } 821 }
822 } 822 }
823 #endif 823 #endif
824 824
1940 if (hr == S_OK && wsz[0] != NUL) 1940 if (hr == S_OK && wsz[0] != NUL)
1941 rfname = utf16_to_enc(wsz, NULL); 1941 rfname = utf16_to_enc(wsz, NULL);
1942 1942
1943 shortcut_errorw: 1943 shortcut_errorw:
1944 vim_free(p); 1944 vim_free(p);
1945 if (hr == S_OK) 1945 goto shortcut_end;
1946 goto shortcut_end;
1947 } 1946 }
1948 } 1947 }
1949 /* Retry with non-wide function (for Windows 98). */ 1948 /* Retry with non-wide function (for Windows 98). */
1950 } 1949 }
1951 # endif 1950 # endif