Do not recreate the debugger options file.
The code for reading in the personalized debugger options, always wrote out the file to account for the case where there may not be a file in the first place. This is not necessary and can lead to the file being changed when running various kinds of debugger tests. Since the tests use a checked in file, it is not desirable for the file to change as a result of a test run. With this change, the file will only be written out when it is missing in the first place. There are still some scenarios where it is possible to write a test that will change the file. Currently no such tests exist. Also, in those scenarios, the test may well want to verify that the file is changed, so more work will needed later on. Right now, that can wait.
Esse commit está contido em:
@@ -2281,7 +2281,9 @@ void DebuggerClient::loadConfig() {
|
||||
}
|
||||
|
||||
// make sure file exists
|
||||
FILE *f = fopen(m_configFileName.c_str(), "a");
|
||||
FILE *f = fopen(m_configFileName.c_str(), "r");
|
||||
bool needToWriteFile = f == nullptr;
|
||||
if (needToWriteFile) f = fopen(m_configFileName.c_str(), "a");
|
||||
if (f) {
|
||||
fclose(f);
|
||||
} else {
|
||||
@@ -2336,7 +2338,9 @@ void DebuggerClient::loadConfig() {
|
||||
|
||||
m_sourceRoot = m_config["SourceRoot"].getString();
|
||||
|
||||
saveConfig(); // so to generate a starter for people
|
||||
if (needToWriteFile) {
|
||||
saveConfig(); // so to generate a starter for people
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerClient::saveConfig() {
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário