summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.175
blob: 99ca39036510dd8c3d92843f35616305968e165c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
To: vim_dev@googlegroups.com
Subject: Patch 7.4.175
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 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)
Files:	    src/os_mswin.c, src/os_win32.c


*** ../vim-7.4.174/src/os_mswin.c	2014-01-14 12:18:41.000000000 +0100
--- src/os_mswin.c	2014-02-11 17:02:03.002214267 +0100
***************
*** 648,654 ****
  	{
  	    n = wstat_symlink_aware(wp, (struct _stat *)stp);
  	    vim_free(wp);
! 	    if (n >= 0)
  		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
--- 648,654 ----
  	{
  	    n = wstat_symlink_aware(wp, (struct _stat *)stp);
  	    vim_free(wp);
! 	    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,822 ****
  	{
  	    n = _wchdir(p);
  	    vim_free(p);
! 	    if (n == 0)
! 		return 0;
  	    /* Retry with non-wide function (for Windows 98). */
  	}
      }
--- 815,822 ----
  	{
  	    n = _wchdir(p);
  	    vim_free(p);
! 	    if (n == 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
! 		return n;
  	    /* Retry with non-wide function (for Windows 98). */
  	}
      }
***************
*** 1942,1949 ****
  
  shortcut_errorw:
  		vim_free(p);
! 		if (hr == S_OK)
! 		    goto shortcut_end;
  	    }
  	}
  	/* Retry with non-wide function (for Windows 98). */
--- 1942,1948 ----
  
  shortcut_errorw:
  		vim_free(p);
! 		goto shortcut_end;
  	    }
  	}
  	/* Retry with non-wide function (for Windows 98). */
*** ../vim-7.4.174/src/os_win32.c	2014-02-05 14:02:23.590105699 +0100
--- src/os_win32.c	2014-02-11 16:59:26.810211874 +0100
***************
*** 2877,2882 ****
--- 2877,2884 ----
  		return OK;
  	    }
  	}
+ 	else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ 	    return FAIL;
  	/* Retry with non-wide function (for Windows 98). */
      }
  #endif
***************
*** 2917,2922 ****
--- 2919,2926 ----
  		return;
  	    }
  	}
+ 	else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ 	    return;
  	/* Retry with non-wide function (for Windows 98). */
      }
  #endif
***************
*** 2966,2971 ****
--- 2970,2977 ----
  		return OK;
  	    }
  	}
+ 	else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ 	    return FAIL;
  	/* Retry with non-wide function (for Windows 98). */
      }
  #endif
***************
*** 3006,3012 ****
  	{
  	    n = _wchmod(p, perm);
  	    vim_free(p);
! 	    if (n == -1 && GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
  		return FAIL;
  	    /* Retry with non-wide function (for Windows 98). */
  	}
--- 3012,3018 ----
  	{
  	    n = _wchmod(p, perm);
  	    vim_free(p);
! 	    if (n == -1 && g_PlatformId == VER_PLATFORM_WIN32_NT)
  		return FAIL;
  	    /* Retry with non-wide function (for Windows 98). */
  	}
***************
*** 6048,6054 ****
  	{
  	    f = _wopen(wn, flags, mode);
  	    vim_free(wn);
! 	    if (f >= 0)
  		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
--- 6054,6060 ----
  	{
  	    f = _wopen(wn, flags, mode);
  	    vim_free(wn);
! 	    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,6105 ****
  	_set_fmode(oldMode);
  # endif
  
! 	if (f != NULL)
  	    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
--- 6105,6111 ----
  	_set_fmode(oldMode);
  # endif
  
! 	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
*** ../vim-7.4.174/src/version.c	2014-02-11 16:00:31.198157698 +0100
--- src/version.c	2014-02-11 16:33:10.002187713 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     175,
  /**/

-- 
DINGO:   And after the spanking ... the oral sex.
GALAHAD: Oh, dear! Well, I...
GIRLS:   The oral sex ...  The oral sex.
GALAHAD: Well, I suppose I could stay a BIT longer.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///