]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add sbuff_char_word to match Perls \w
authorAlan T. DeKok <aland@freeradius.org>
Sun, 19 Jun 2022 13:20:11 +0000 (09:20 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 20 Jun 2022 15:47:00 +0000 (11:47 -0400)
For now, no unicode / UTF-8 support.  Sorry.  :(

src/lib/util/sbuff.c
src/lib/util/sbuff.h

index bf4313250b3bc6530669b6f024fa62b1eca030ed..2c0cdbc78840d109003848d5bfd328ca609e7681 100644 (file)
@@ -85,6 +85,10 @@ bool const sbuff_char_class_hostname[UINT8_MAX + 1] = {
 
 bool const sbuff_char_class_hex[UINT8_MAX + 1] = { SBUFF_CHAR_CLASS_HEX };
 bool const sbuff_char_alpha_num[UINT8_MAX + 1] = { SBUFF_CHAR_CLASS_ALPHA_NUM };
+bool const sbuff_char_word[UINT8_MAX + 1] = {
+       SBUFF_CHAR_CLASS_ALPHA_NUM,
+       ['-'] = true, ['_'] = true,
+};
 bool const sbuff_char_whitespace[UINT8_MAX + 1] = {
        ['\t'] = true, ['\n'] = true, ['\r'] = true, ['\f'] = true, ['\v'] = true, [' '] = true,
 };
index 874c0d6211a1ddab86d7db600887a25aee784cdf..ef7c5d401f5a0f549e16f1277034caa7b42a02f7 100644 (file)
@@ -267,6 +267,7 @@ extern bool const sbuff_char_class_float[UINT8_MAX + 1];
 extern bool const sbuff_char_class_zero[UINT8_MAX + 1];
 extern bool const sbuff_char_class_hex[UINT8_MAX + 1];
 extern bool const sbuff_char_alpha_num[UINT8_MAX + 1];
+extern bool const sbuff_char_word[UINT8_MAX + 1];
 extern bool const sbuff_char_whitespace[UINT8_MAX + 1];
 extern bool const sbuff_char_line_endings[UINT8_MAX + 1];
 extern bool const sbuff_char_blank[UINT8_MAX + 1];