diff options
author | Simon McVittie <smcv@collabora.com> | 2018-10-18 15:34:09 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2018-10-19 11:11:55 +0000 |
commit | 99580298f305e1e2426f0c016d797a1ff9ea0b79 (patch) | |
tree | cfbd2055211759258f43b120d3d9abcce2d3138a /bus/desktop-file.c | |
parent | bd9b26ae47401d31a662138e91cd2f7d190df059 (diff) | |
download | dbus-99580298f305e1e2426f0c016d797a1ff9ea0b79.tar.gz |
desktop-file: Justify implementation of is_valid_section_name()
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'bus/desktop-file.c')
-rw-r--r-- | bus/desktop-file.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bus/desktop-file.c b/bus/desktop-file.c index 0b9c57cc..1c4bb884 100644 --- a/bus/desktop-file.c +++ b/bus/desktop-file.c @@ -378,7 +378,12 @@ parse_comment_or_blank (BusDesktopFileParser *parser) static dbus_bool_t is_valid_section_name (const char *name) { - /* 5. Group names may contain all ASCII characters except for control characters and '[' and ']'. */ + /* 5. Group names may contain all ASCII characters except for control characters and '[' and ']'. + * + * We don't use isprint() here because it's locale-dependent. ASCII + * characters <= 0x1f and 0x7f are control characters, and bytes with + * values >= 0x80 aren't ASCII. 0x20 is a space, which we must allow, + * not least because DBUS_SERVICE_SECTION contains one. */ while (*name) { |