]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: tools: also accept '+' as a valid character in an identifier
authorWilly Tarreau <w@1wt.eu>
Mon, 17 Feb 2020 05:34:11 +0000 (06:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 17 Feb 2020 05:37:40 +0000 (06:37 +0100)
The function is_idchar() was added by commit 36f586b ("MINOR: tools:
add is_idchar() to tell if a char may belong to an identifier") to
ease matching of sample fetch/converter names. But it lacked support
for the '+' character used in "base32+src" and "url32+src". A quick
way to figure the list of supported sample fetch+converter names is
to issue the following command:

   git grep '"[^"]*",.*SMP_T_.*SMP_USE_'|cut -f2 -d'"'|sort -u

No more entry is reported once searching for characters not covered
by is_idchar().

No backport is needed.

include/common/standard.h

index da2efcfbb6b37b66e761be1f053b60612a3f55ea..6d2432f991b590b9b24f0d8fd3570b34a7256b5b 100644 (file)
@@ -373,13 +373,13 @@ extern const char *invalid_domainchar(const char *name);
 extern const char *invalid_prefix_char(const char *name);
 
 /* returns true if <c> is an identifier character, that is, a digit, a letter,
- * or '-', '_', ':' or '.'. This is usable for proxy names, server names, ACL
- * names, sample fetch names, and converter names.
+ * or '-', '+', '_', ':' or '.'. This is usable for proxy names, server names,
+ * ACL names, sample fetch names, and converter names.
  */
 static inline int is_idchar(char c)
 {
        return isalnum((int)(unsigned char)c) ||
-              c == '.' || c == '_' || c == '-' || c == ':';
+              c == '.' || c == '_' || c == '-' || c == '+' || c == ':';
 }
 
 /*