mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 15:00:11 +01:00
Somewhat more reasonable .ini name determination
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@177 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
e405578b33
commit
2dcbca898a
@ -128,13 +128,12 @@ void build_extension_list() {
|
||||
}
|
||||
|
||||
void GetINIFileName(char * iniFile) {
|
||||
/* if we've got a valid hwnd then we're running on a newer winamp version
|
||||
* that better supports saving of settings to a per-user directory - if not
|
||||
/* if we're running on a newer winamp version that better supports
|
||||
* saving of settings to a per-user directory, use that directory - if not
|
||||
* then just revert to the old behaviour */
|
||||
|
||||
if(IsWindow(input_module.hMainWindow)) {
|
||||
char * iniDir = (char*)SendMessage(input_module.hMainWindow, WM_WA_IPC, 0, IPC_GETINIDIRECTORY);
|
||||
if (iniDir) {
|
||||
if(IsWindow(input_module.hMainWindow) && SendMessage(input_module.hMainWindow, WM_WA_IPC,0,IPC_GETVERSION) >= 0x5000) {
|
||||
char * iniDir = (char *)SendMessage(input_module.hMainWindow, WM_WA_IPC, 0, IPC_GETINIDIRECTORY);
|
||||
strncpy(iniFile, iniDir, MAX_PATH);
|
||||
|
||||
strncat(iniFile, "\\Plugins\\", MAX_PATH);
|
||||
@ -142,15 +141,13 @@ void GetINIFileName(char * iniFile) {
|
||||
mkdir(iniFile);
|
||||
strncat(iniFile, INI_NAME, MAX_PATH);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetModuleFileName(GetModuleHandle(BINARY_NAME), iniFile, MAX_PATH)) {
|
||||
else {
|
||||
GetModuleFileName(NULL, iniFile, MAX_PATH);
|
||||
char * lastSlash = strrchr(iniFile, '\\');
|
||||
|
||||
*(lastSlash + 1) = 0;
|
||||
strcat(iniFile, INI_NAME);
|
||||
strncat(iniFile, "\\Plugins\\" INI_NAME,MAX_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user