diff options
author | Berke Viktor <berkeviktor@aol.com> | 2011-11-29 20:15:56 +0100 |
---|---|---|
committer | Berke Viktor <berkeviktor@aol.com> | 2011-11-29 20:15:56 +0100 |
commit | b16ca3fa64fc1fa83d40d00d0090cc7fd27a9840 (patch) | |
tree | f7eac0939e9afe2d72cf2208c42f0e9a5e7de4a4 /src/common/util.c | |
parent | 266a86d0b5383db9a998b9b6412947fbbdac58a1 (diff) |
initial plugin config framework, can't save multiple entries
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index 870f4d5c..c16d41f5 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1830,3 +1830,21 @@ safe_strcpy (char *dest, const char *src, int bytes_left) } } } + +void +canonalize_key (char *key) +{ + char *pos, token; + + for (pos = key; (token = *pos) != 0; pos++) + { + if (token != '_' && (token < '0' || token > '9') && (token < 'A' || token > 'Z') && (token < 'a' || token > 'z')) + { + *pos = '_'; + } + else + { + *pos = tolower(token); + } + } +} |