Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix legacy parsing of DEBUG_ALL option #2205

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions src/config/legacy_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,13 +835,20 @@ static void readDebugingSettingsLegacy(FILE *fp)
opened = true;
}

// DEBUG_ALL
// defaults to: false
// ~0 is a shortcut for "all bits set"
setDebugOption(fp, "DEBUG_ALL", ~(enum debug_flag)0);

for(enum debug_flag flag = DEBUG_DATABASE; flag < DEBUG_EXTRA; flag <<= 1)
setDebugOption(fp, debugstr(flag), flag);
bool bit = false;
const char *debug_all = parseFTLconf(fp, "DEBUG_ALL");
if(debug_all != NULL && parseBool(debug_all, &bit) && bit)
{
// Set all debug flags if DEBUG_ALL is set to true
set_all_debug(&config, true);
}
else
{
// Iterate over all debug flags and set them if they are present
// in the config file.
for(enum debug_flag flag = DEBUG_DATABASE; flag < DEBUG_EXTRA; flag <<= 1)
setDebugOption(fp, debugstr(flag), flag);
}

// Parse debug options
set_debug_flags(&config);
Expand Down
Loading