From: Jinoh Kang jinoh.kang.kr@gmail.com
Fixes: f768d6b31bebc35fbaf751d0cd57c8bd302a8d60 --- libs/fluidsynth/glib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libs/fluidsynth/glib.c b/libs/fluidsynth/glib.c index 3953392b86f..8266ac4bda1 100644 --- a/libs/fluidsynth/glib.c +++ b/libs/fluidsynth/glib.c @@ -102,7 +102,10 @@ void g_clear_error( GError **error ) int g_file_test( const char *path, int test ) { DWORD attrs = GetFileAttributesA( path ); - if (test == G_FILE_TEST_EXISTS) return attrs != INVALID_FILE_ATTRIBUTES; - if (test == G_FILE_TEST_IS_REGULAR) return attrs == FILE_ATTRIBUTE_NORMAL; + if (attrs != INVALID_FILE_ATTRIBUTES) + { + if (test & G_FILE_TEST_EXISTS) return 1; + if ((test & G_FILE_TEST_IS_REGULAR) && !(attrs & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE))) return 1; + } return 0; }