mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
LibCore: Trim trailing whitespaces from ConfigFile values
Previously, trailing whitespaces were not removed from values in config files. This could cause errors with poorly formatted files. This commit fixes this by trimming whitespaces from values in ConfigFile::reparse().
This commit is contained in:
parent
20f730dc1c
commit
53c8faaafc
Notes:
sideshowbarker
2024-07-18 01:30:09 +09:00
Author: https://github.com/tclaesson 🔰
Commit: 53c8faaafc
Pull-request: https://github.com/SerenityOS/serenity/pull/10790
Reviewed-by: https://github.com/bcoles
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Reviewed-by: https://github.com/sin-ack ✅
1 changed files with 2 additions and 1 deletions
|
@ -106,7 +106,8 @@ void ConfigFile::reparse()
|
|||
// We're not in a group yet, create one with the name ""...
|
||||
current_group = &m_groups.ensure("");
|
||||
}
|
||||
current_group->set(key_builder.to_string(), value_builder.to_string());
|
||||
auto value_string = value_builder.to_string();
|
||||
current_group->set(key_builder.to_string(), value_string.trim_whitespace(TrimMode::Right));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue