Mercurial > dovecot > core-2.2
changeset 22466:df0a2f4282f8
lib-settings: Escape comma in section name.
Comma is valid symbol in encoded non-ascii section names, so it
shouldn't be used as splitting symbol in section name.
author | Sergey Kitov <sergey.kitov@open-xchange.com> |
---|---|
date | Thu, 24 Aug 2017 10:01:02 +0300 |
parents | ff8873d5675a |
children | d4274c2f8468 |
files | src/lib-settings/settings-parser.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-settings/settings-parser.c Thu Aug 17 13:20:26 2017 +0300 +++ b/src/lib-settings/settings-parser.c Thu Aug 24 10:01:02 2017 +0300 @@ -2124,7 +2124,7 @@ const char *settings_section_escape(const char *name) { #define CHAR_NEED_ESCAPE(c) \ - ((c) == '=' || (c) == SETTINGS_SEPARATOR || (c) == '\\' || (c) == ' ') + ((c) == '=' || (c) == SETTINGS_SEPARATOR || (c) == '\\' || (c) == ' ' || (c) == ',') string_t *str; unsigned int i; @@ -2151,6 +2151,9 @@ case ' ': str_append(str, "\\_"); break; + case ',': + str_append(str, "\\+"); + break; default: str_append_c(str, name[i]); break;