Subversion Repositories eduke32

Compare Revisions

Regard whitespace Rev 5075 → Rev 5076

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