diff options
author | erorcun <erayorcunus@gmail.com> | 2020-07-28 16:41:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 16:41:49 +0200 |
commit | e47eaa1425176e21d684b3bcb87c198dd9c5b05f (patch) | |
tree | b3925fee0ec654339175c156e8c9733886517998 /src/audio/oal | |
parent | collision fixes (diff) | |
parent | Fix casepath chaos (diff) | |
download | re3-e47eaa1425176e21d684b3bcb87c198dd9c5b05f.tar re3-e47eaa1425176e21d684b3bcb87c198dd9c5b05f.tar.gz re3-e47eaa1425176e21d684b3bcb87c198dd9c5b05f.tar.bz2 re3-e47eaa1425176e21d684b3bcb87c198dd9c5b05f.tar.lz re3-e47eaa1425176e21d684b3bcb87c198dd9c5b05f.tar.xz re3-e47eaa1425176e21d684b3bcb87c198dd9c5b05f.tar.zst re3-e47eaa1425176e21d684b3bcb87c198dd9c5b05f.zip |
Diffstat (limited to 'src/audio/oal')
-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 1ffe941e..9fad47a9 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -203,15 +203,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) + 4); - 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 |