Trim newlines

This commit is contained in:
Alexey Milovidov 2024-10-03 03:34:54 +02:00
parent 1ffae83809
commit 9a30ae7c37

View File

@ -6209,7 +6209,15 @@ void Settings::dumpToSystemSettingsColumns(MutableColumnsAndConstraints & params
{
res_columns[1]->insert(setting.getValueString());
res_columns[2]->insert(setting.isValueChanged());
res_columns[3]->insert(setting.getDescription());
/// Trim starting/ending newline.
std::string_view doc = setting.getDescription();
if (doc.length() > 0 && doc[0] == '\n')
doc = doc.substr(1);
if (doc.length() > 0 && doc[doc.length() - 1] == '\n')
doc = doc.substr(0, doc.length() - 1);
res_columns[3]->insert(doc);
Field min, max;
SettingConstraintWritability writability = SettingConstraintWritability::WRITABLE;