]> andersk Git - moira.git/blobdiff - update/config.c
New DCM using embedded SQL instead of libmrglue
[moira.git] / update / config.c
index ee435c0b1d75c3f1bb164e595f21be4e331bf136..99e88cee840e7383a1ff10cdeca2176782c9c969 100644 (file)
 
 #include <mit-copyright.h>
 #include <stdio.h>
+#include <string.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/file.h>
+#include <fcntl.h>
 #include <moira.h>
 
 
@@ -76,13 +78,8 @@ static init()
        return(MR_NO_MEM);
     }
     count = 0;
-    for (p = start = config_buf; *p; p++) {
-       if (*p != '\n')
-         continue;
-       *p++ = '\0';
-       config_keys[count++] = start;
-       start = p;
-       if (!*p) break;
+    for (p = strtok(config_buf, "\n"); p; p = strtok(NULL, "\n")) {
+       config_keys[count++] = p;
     }
     config_keys[count] = NULL;
     for (count = 0; config_keys[count]; count++) {
This page took 0.361391 seconds and 4 git commands to generate.