]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Make Section names case-insensitive which should
authorSteve Dickson <steved@redhat.com>
Wed, 5 Aug 2009 19:53:36 +0000 (15:53 -0400)
committerSteve Dickson <steved@redhat.com>
Sun, 16 Aug 2009 20:53:05 +0000 (16:53 -0400)
help in locating them resulting in make the config
files a bit less error prone

Signed-off-by: Steve Dickson <steved@redhat.com>
support/nfs/conffile.c

index 5f491eb7c8a5de6de270a86b5c70cef08d642383..a8b803758f85c2f58d196bb2643874a2371ddb61 100644 (file)
@@ -115,6 +115,18 @@ conf_hash(char *s)
        return hash;
 }
 
+/*
+ * 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)
  */
@@ -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);