/ini does not delete keys or sections
Posted: Mon Sep 17, 2012 5:34 pm
Here is the fix. Replace the if block begining on line 2449 in MQ2Commands.cpp
Code: Select all
if (!strlen(szArg4) && strlen(szArg3)) { //Deleting a key within a [section].
if (!WritePrivateProfileString(szArg2,szArg3,NULL,szArg1)) {
sprintf(szOutput,"IniOutput ERROR -- during WritePrivateProfileString: %s",szLine);
DebugSpew(szOutput);
} else {
sprintf(szOutput,"IniOutput Write Successful!");
DebugSpew("%s: %s",szOutput,szLine);
}
} else if (!strlen(szArg4) && !strlen(szArg3)) { //Deleting a [section] and all keys under it.
if (!WritePrivateProfileString(szArg2,NULL,NULL,szArg1)) {
sprintf(szOutput,"IniOutput ERROR -- during WritePrivateProfileString: %s",szLine);
DebugSpew(szOutput);
} else {
sprintf(szOutput,"IniOutput Write Successful!");
DebugSpew("%s: %s",szOutput,szLine);
}
} else {
if (!WritePrivateProfileString(szArg2,szArg3,szArg4,szArg1)) {
sprintf(szOutput,"IniOutput ERROR -- during WritePrivateProfileString: %s",szLine);
DebugSpew(szOutput);
} else {
sprintf(szOutput,"IniOutput Write Successful!");
DebugSpew("%s: %s",szOutput,szLine);
}
}