]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd_io.cpp
Fixed a permissions error, was doing work as root!
[user/henk/code/inspircd.git] / src / inspircd_io.cpp
index c69ba3b176936591e8e4759be85a2a8343bacacb..b267e98ca8f12b20cffdfaed13d6183a798174a7 100644 (file)
@@ -324,7 +324,7 @@ int ConfValueEnum(char* tag, std::stringstream* config)
 int ReadConf(std::stringstream *config, const char* tag, const char* var, int index, char *result)
 {
        int ptr = 0;
-       char buffer[MAXBUF], c_tag[MAXBUF], c, lastc;
+       char buffer[65535], c_tag[MAXBUF], c, lastc;
        int in_token, in_quotes, tptr, j, idx = 0;
        char* key;
 
@@ -336,18 +336,15 @@ int ReadConf(std::stringstream *config, const char* tag, const char* var, int in
        in_token = 0;
        in_quotes = 0;
        lastc = '\0';
+       c_tag[0] = '\0';
+       buffer[0] = '\0';
        while (bptr<len)
        {
                lastc = c;
                c = buf[bptr++];
-               if ((c == '#') && (lastc == '\n'))
-               {
-                       while ((c != '\n') && (bptr<len))
-                       {
-                               lastc = c;
-                               c = buf[bptr++];
-                       }
-               }
+               // FIX: Treat tabs as spaces
+               if (c == 9)
+                       c = 32;
                if ((c == '<') && (!in_quotes))
                {
                        tptr = 0;
@@ -359,7 +356,8 @@ int ReadConf(std::stringstream *config, const char* tag, const char* var, int in
                                        c_tag[tptr++] = c;
                                        c_tag[tptr] = '\0';
                                }
-                       } while (c != ' ');
+                       // FIX: Tab can follow a tagname as well as space.
+                       } while ((c != ' ') && (c != 9));
                }
                if (c == '"')
                {