Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 5076 → Rev 5075

/polymer/eduke32/build/src/cache1d.c
914,44 → 914,45
// http://stackoverflow.com/questions/74451/getting-actual-file-name-with-proper-casing-on-windows
// for relevant discussion.
 
static char fnbuf[BMAX_PATH];
int fnofs;
static SHFILEINFO shinf;
 
int32_t (*check_filename_casing_fn)(void) = NULL;
 
// -1: failure, 0: match, 1: mismatch
static int32_t check_filename_mismatch(const char * const filename, int ofs)
static int32_t check_filename_mismatch(const char *filename, int32_t ofs)
{
if (!GetShortPathNameA(filename, fnbuf, BMAX_PATH)) return -1;
if (!GetLongPathNameA(fnbuf, fnbuf, BMAX_PATH)) return -1;
const char *fn = filename+ofs;
int32_t len;
 
fnofs = ofs;
// we assume that UNICODE is not #defined, winlayer.c errors out else
if (!SHGetFileInfo(filename, -1, &shinf, sizeof(shinf), SHGFI_DISPLAYNAME))
return -1;
 
int len = Bstrlen(fnbuf+ofs);
len = Bstrlen(shinf.szDisplayName);
 
char const * const fn = filename+ofs;
 
if (!Bstrncmp(fnbuf+ofs, fn, len))
if (!Bstrncmp(shinf.szDisplayName, fn, len))
return 0;
 
char * const tfn = Bstrtolower(Xstrdup(fn));
 
if (!Bstrncmp(fnbuf+ofs, tfn, len))
{
Bfree(tfn);
return 0;
}
char *tfn = Bstrtolower(Xstrdup(fn));
 
Bstrupr(tfn);
if (!Bstrncmp(shinf.szDisplayName, tfn, len))
{
Bfree(tfn);
return 0;
}
 
if (!Bstrncmp(fnbuf+ofs, tfn, len))
{
Bstrupr(tfn);
 
if (!Bstrncmp(shinf.szDisplayName, tfn, len))
{
Bfree(tfn);
return 0;
}
 
Bfree(tfn);
return 0;
}
 
Bfree(tfn);
 
return 1;
}
#endif
991,7 → 992,7
else if (status == 1)
{
initprintf("warning: case mismatch: passed \"%s\", real \"%s\"\n",
lastslash, fnbuf+fnofs);
lastslash, shinf.szDisplayName);
}
}
#else