mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
win32.c: suppress a warning
* win32/win32.c (get_attr_vsn): assume GetLastError() never return 0, to suppress a maybe-uninitialized warning in wrename(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5e57dc0fae
commit
649016bdb1
1 changed files with 5 additions and 2 deletions
|
@ -4981,9 +4981,12 @@ get_attr_vsn(const WCHAR *path, DWORD *atts, DWORD *vsn)
|
|||
DWORD e = 0;
|
||||
HANDLE h = open_special(path, 0, FILE_FLAG_OPEN_REPARSE_POINT);
|
||||
|
||||
if (h == INVALID_HANDLE_VALUE) return GetLastError();
|
||||
if (h == INVALID_HANDLE_VALUE) {
|
||||
ASSUME(e = GetLastError());
|
||||
return e;
|
||||
}
|
||||
if (!GetFileInformationByHandle(h, &st)) {
|
||||
e = GetLastError();
|
||||
ASSUME(e = GetLastError());
|
||||
}
|
||||
else {
|
||||
*atts = st.dwFileAttributes;
|
||||
|
|
Loading…
Reference in a new issue