work with either all ucase or all lcase .wav name

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@294 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2008-07-06 18:18:25 +00:00
parent d210bc5bfc
commit 6f4410dd2c

View File

@ -26,11 +26,16 @@ VGMSTREAM * init_vgmstream_pos(STREAMFILE *streamFile) {
/* check for .WAV file */
strcpy(filenameWAV,filename);
strcpy(filenameWAV+strlen(filenameWAV)-3,"wav");
for (i=strlen(filenameWAV);i>=0&&filenameWAV[i]!=DIRSEP;i--)
filenameWAV[i]=toupper(filenameWAV[i]);
streamFileWAV = streamFile->open(streamFile,filenameWAV,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!streamFileWAV) goto fail;
if (!streamFileWAV) {
/* try again, ucase */
for (i=strlen(filenameWAV);i>=0&&filenameWAV[i]!=DIRSEP;i--)
filenameWAV[i]=toupper(filenameWAV[i]);
streamFileWAV = streamFile->open(streamFile,filenameWAV,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!streamFileWAV) goto fail;
}
/* let the real initer do the parsing */
vgmstream = init_vgmstream_riff(streamFileWAV);