Use blergconf for paths
[blerg.git] / database / database.c
index 91e6aa2..0386132 100644 (file)
@@ -156,7 +156,7 @@ int blerg_exists(const char *name) {
                return 0;
        }
 
-       snprintf(filename, 512, "%s/%s", DATA_PATH, name);
+       snprintf(filename, 512, "%s/%s", blergconf.data_path, name);
        if (access(filename, F_OK) == -1)
                return 0;
        else
@@ -187,7 +187,7 @@ struct blerg *blerg_open(const char *name) {
 
        /* Make the directory if it doesn't exist */
        blerg->base_path = malloc(512);
-       snprintf(blerg->base_path, 512, "%s/%s", DATA_PATH, name);
+       snprintf(blerg->base_path, 512, "%s/%s", blergconf.data_path, name);
        if (access(blerg->base_path, F_OK) == -1)
                mkdir(blerg->base_path, 0755);