]> git.webhop.me Git - lcd4linux.git/commitdiff
removed backslash handling from cfg.c (its now part of the evaluator)
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 29 Jan 2009 06:25:31 +0000 (06:25 +0000)
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 29 Jan 2009 06:25:31 +0000 (06:25 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@982 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

cfg.c

diff --git a/cfg.c b/cfg.c
index 9bf3f577e0bea45f955ae62c935020cae136865f..85da6ce8ad4dd314d70b7ef63ee21d08df9d5ef6 100644 (file)
--- a/cfg.c
+++ b/cfg.c
@@ -157,41 +157,6 @@ static char *strip(char *s, const int strip_comments)
 }
 
 
-/* unquote a string */
-static char *dequote(char *string)
-{
-    int quote = 0;
-    char *s = string;
-    char *p = string;
-
-    do {
-       if (*s == '\'') {
-           quote = !quote;
-           *p++ = *s;
-       } else if (quote && *s == '\\') {
-           s++;
-           if (*s >= '0' && *s <= '7') {
-               int n;
-               unsigned int c = 0;
-               sscanf(s, "%3o%n", &c, &n);
-               if (c == 0 || c > 255) {
-                   error("WARNING: illegal '\\' in <%s>", string);
-               } else {
-                   *p++ = c;
-                   s += n - 1;
-               }
-           } else {
-               *p++ = *s;
-           }
-       } else {
-           *p++ = *s;
-       }
-    } while (*s++);
-
-    return string;
-}
-
-
 /* which if a string contains only valid chars */
 /* i.e. start with a char and contains chars and nums */
 static int validchars(const char *string, const int numstart)
@@ -240,14 +205,14 @@ static void cfg_add(const char *section, const char *key, const char *val, const
        free(buffer);
        if (entry->val)
            free(entry->val);
-       entry->val = dequote(strdup(val));
+       entry->val = strdup(val);
        return;
     }
 
     nConfig++;
     Config = realloc(Config, nConfig * sizeof(ENTRY));
     Config[nConfig - 1].key = buffer;
-    Config[nConfig - 1].val = dequote(strdup(val));
+    Config[nConfig - 1].val = strdup(val);
     Config[nConfig - 1].lock = lock;
 
     qsort(Config, nConfig, sizeof(ENTRY), c_sort);