mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-05-31 01:00:53 +00:00
reorder calls to fluid_file_test
This commit is contained in:
parent
ff6377a3bd
commit
12dd1c7653
3 changed files with 21 additions and 18 deletions
|
@ -24,21 +24,26 @@
|
|||
|
||||
void *default_fopen(const char *path)
|
||||
{
|
||||
FILE* handle = FLUID_FOPEN(path, "rb");
|
||||
FILE* handle;
|
||||
|
||||
if(handle == NULL)
|
||||
if(!fluid_file_test(path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Specified file does not exists or insufficient permissions to open it! ('%s')", path);
|
||||
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Unable to load non-existent file. ('%s')", path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(!fluid_file_test(path, G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
FLUID_FCLOSE(handle);
|
||||
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Refusing to load non-regular file! ('%s')", path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((handle = FLUID_FOPEN(path, "rb")) == NULL)
|
||||
{
|
||||
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Specified file does not exists or insufficient permissions to open it! ('%s')", path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue