diff -r 51a084acef49 -r 6a8a57779674 librazor/dump.c --- a/librazor/dump.c Fri Oct 17 10:08:28 2014 +0100 +++ b/librazor/dump.c Fri Jul 08 15:54:49 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 J. Ali Harlow + * Copyright (C) 2014, 2016 J. Ali Harlow * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -356,11 +356,11 @@ } RAZOR_EXPORT int -razor_dump_database(FILE *fp, const char *root, const char *filename, +razor_dump_database(FILE *fp, const char *root_uri, const char *filename, struct razor_error **error) { int i; - char *s, *path, *data; + char *s, *uri, *data; struct array pool = { 0, }; struct array string_pool = { 0, }; struct array file_string_pool = { 0, }; @@ -377,11 +377,14 @@ if (!filename) filename = "system.rzdb"; - s = razor_concat(razor_get_database_path(), "/", filename, NULL); - path = razor_path_add_root(s, root); - free(s); - contents = razor_file_get_contents(path, &length, 0, error); - free(path); + uri = razor_resolve_database_file(root_uri, filename, error); + + if (!uri) + return -1; + + contents = razor_uri_get_contents(uri, &length, 0, error); + + free(uri); if (!contents) return -1; @@ -482,7 +485,7 @@ fprintf(fp, "%05lX EOF\n", (unsigned long)n); - razor_file_free_contents(contents, length); + razor_uri_free_contents(contents, length); return 0; }