summaryrefslogtreecommitdiffstats
path: root/src/audio/oal/stream.cpp
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-07-28 17:33:27 +0200
committerGitHub <noreply@github.com>2020-07-28 17:33:27 +0200
commit3d91d4fc6ae31da9c3c93455e1f6e3eea8d8eef5 (patch)
tree5805f0a7f60da9ba4acd0e60700f0418c1f01188 /src/audio/oal/stream.cpp
parentMerge pull request #665 from erorcun/miami (diff)
parentFix casepath chaos (diff)
downloadre3-3d91d4fc6ae31da9c3c93455e1f6e3eea8d8eef5.tar
re3-3d91d4fc6ae31da9c3c93455e1f6e3eea8d8eef5.tar.gz
re3-3d91d4fc6ae31da9c3c93455e1f6e3eea8d8eef5.tar.bz2
re3-3d91d4fc6ae31da9c3c93455e1f6e3eea8d8eef5.tar.lz
re3-3d91d4fc6ae31da9c3c93455e1f6e3eea8d8eef5.tar.xz
re3-3d91d4fc6ae31da9c3c93455e1f6e3eea8d8eef5.tar.zst
re3-3d91d4fc6ae31da9c3c93455e1f6e3eea8d8eef5.zip
Diffstat (limited to 'src/audio/oal/stream.cpp')
-rw-r--r--src/audio/oal/stream.cpp12
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