diff options
Diffstat (limited to 'src/audio')
-rw-r--r-- | src/audio/oal/stream.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 40ec57fa..b689e929 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -255,15 +255,11 @@ CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUF { // Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/) #if !defined(_WIN32) - FILE *test = fopen(filename, "r"); - if (!test) { - char *r = (char*)alloca(strlen(filename) + 2); - if (casepath(filename, r)) - { - strcpy(m_aFilename, r); - } + char *real = casepath(filename); + if (real) { + strcpy(m_aFilename, real); + free(real); } else { - fclose(test); #else { #endif |