diff options
Diffstat (limited to 'win32/file.c')
-rw-r--r-- | win32/file.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/win32/file.c b/win32/file.c index cd89da24f5..13325a3d08 100644 --- a/win32/file.c +++ b/win32/file.c @@ -4,22 +4,22 @@ int rb_file_load_ok(const char *path) { - int ret = 1; - DWORD attr = GetFileAttributes(path); - if (attr == INVALID_FILE_ATTRIBUTES || + int ret = 1; + DWORD attr = GetFileAttributes(path); + if (attr == INVALID_FILE_ATTRIBUTES || attr & FILE_ATTRIBUTE_DIRECTORY) { ret = 0; - } - else { + } + else { HANDLE h = CreateFile(path, GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (h != INVALID_HANDLE_VALUE) { - CloseHandle(h); + CloseHandle(h); } else { - ret = 0; + ret = 0; } - } - return ret; + } + return ret; } |