mirror of
https://github.com/GTAmodding/re3.git
synced 2025-10-05 22:50:00 +00:00
Fix casepath chaos
This commit is contained in:
parent
98ec7bdaf9
commit
eb8844fd11
6 changed files with 134 additions and 132 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue