]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
desktop-file: Justify implementation of is_valid_section_name()
authorSimon McVittie <smcv@collabora.com>
Thu, 18 Oct 2018 14:34:09 +0000 (15:34 +0100)
committerSimon McVittie <smcv@collabora.com>
Fri, 19 Oct 2018 11:11:55 +0000 (11:11 +0000)
Signed-off-by: Simon McVittie <smcv@collabora.com>
bus/desktop-file.c

index 0b9c57cc87078f79be461cc70cd8de9d7dbc1f94..1c4bb8844ce8be3ab3ab24e9f7f142818098dd22 100644 (file)
@@ -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)
     {