summaryrefslogtreecommitdiff
path: root/3rdparty/libconfig/libconfig.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-10-10 21:37:48 +0200
committerHaru <haru@dotalux.com>2015-10-11 05:14:59 +0200
commit34bdc27cabdc2c37e9b486013bf5ab42e8995e88 (patch)
tree5408c9abe51397df3277e4eccfb5cfce6b7f7420 /3rdparty/libconfig/libconfig.c
parent2d51cded8d5612b7ecbe171a6ca309e91d14bfd7 (diff)
downloadhercules-34bdc27cabdc2c37e9b486013bf5ab42e8995e88.tar.gz
hercules-34bdc27cabdc2c37e9b486013bf5ab42e8995e88.tar.bz2
hercules-34bdc27cabdc2c37e9b486013bf5ab42e8995e88.tar.xz
hercules-34bdc27cabdc2c37e9b486013bf5ab42e8995e88.zip
Added support to libconfig for key names containing '.' or beginnig with digits.
- Note: Since '.' (period) is a valid character for key names, it is no longer a valid path separator for lookups. Please use '/' (forward slash) or ':' (semicolon) instead. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to '3rdparty/libconfig/libconfig.c')
-rw-r--r--3rdparty/libconfig/libconfig.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/3rdparty/libconfig/libconfig.c b/3rdparty/libconfig/libconfig.c
index 358c415f5..8f2b3fb42 100644
--- a/3rdparty/libconfig/libconfig.c
+++ b/3rdparty/libconfig/libconfig.c
@@ -40,7 +40,7 @@
#include <string.h>
#include <ctype.h>
-#define PATH_TOKENS ":./"
+#define PATH_TOKENS ":/"
#define CHUNK_SIZE 16
#define FLOAT_PRECISION 10
@@ -537,12 +537,13 @@ static int __config_validate_name(const char *name)
if(*p == '\0')
return(CONFIG_FALSE);
- if(! isalpha((int)*p) && (*p != '*'))
+ if(! isalpha((int)*p) && !isdigit((int)*p) && (*p != '*')) {
return(CONFIG_FALSE);
+ }
for(++p; *p; ++p)
{
- if(! (isalpha((int)*p) || isdigit((int)*p) || strchr("*_-'", (int)*p)))
+ if(! (isalpha((int)*p) || isdigit((int)*p) || strchr("*_-'.", (int)*p)))
return(CONFIG_FALSE);
}