mirror of
https://github.com/GTAmodding/re3.git
synced 2025-10-12 10:40:54 +00:00
Fix casepath chaos
This commit is contained in:
parent
ef7afe5f2f
commit
c87b639a84
6 changed files with 150 additions and 119 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue