diff options
author | Steve Dickson <steved@redhat.com> | 2009-08-05 15:53:36 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-08-16 16:53:05 -0400 |
commit | c6a270ea8ab6ad299e6a43445420f22e0c617e3e (patch) | |
tree | 7807e40a6ba1d624afd76310763cf56f0cd9de70 /support/nfs | |
parent | a61e7ab6dbf7e3d6ad4e6377c96748dfaf353542 (diff) | |
download | nfs-utils-c6a270ea8ab6ad299e6a43445420f22e0c617e3e.tar.gz nfs-utils-c6a270ea8ab6ad299e6a43445420f22e0c617e3e.tar.xz nfs-utils-c6a270ea8ab6ad299e6a43445420f22e0c617e3e.zip |
Make Section names case-insensitive which should
help in locating them resulting in make the config
files a bit less error prone
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfs')
-rw-r--r-- | support/nfs/conffile.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c index 5f491eb..a8b8037 100644 --- a/support/nfs/conffile.c +++ b/support/nfs/conffile.c @@ -116,6 +116,18 @@ conf_hash(char *s) } /* + * Convert letter from upper case to lower case + */ +static inline void upper2lower(char *str) +{ + char *ptr = str; + + while (*ptr) + *ptr++ = tolower(*ptr); +} + + +/* * Insert a tag-value combination from LINE (the equal sign is at POS) */ static int @@ -654,6 +666,9 @@ conf_set(int transaction, char *section, char *tag, xlog_warn("conf_set: strdup(\"%s\") failed", section); goto fail; } + /* Make Section names case-insensitive */ + upper2lower(node->section); + node->tag = strdup(tag); if (!node->tag) { xlog_warn("conf_set: strdup(\"%s\") failed", tag); |