From 6ac6d7448aa0a976e7347daf8b48d6e56216af85 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 5 May 2014 15:38:33 +0000 Subject: Fix use of lv2info -m and -p options to write plugin data. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5401 a436a847-0d15-0410-975c-d299462d15a1 --- utils/lv2info.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'utils/lv2info.c') diff --git a/utils/lv2info.c b/utils/lv2info.c index d20789e..3bd79f4 100644 --- a/utils/lv2info.c +++ b/utils/lv2info.c @@ -1,5 +1,5 @@ /* - Copyright 2007-2011 David Robillard + Copyright 2007-2014 David Robillard Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -399,17 +399,25 @@ main(int argc, char** argv) const LilvPlugin* p = lilv_plugins_get_by_uri(plugins, uri); if (p && plugin_file) { - LilvNode* base = lilv_new_uri(world, plugin_file); + LilvNode* base = lilv_new_file_uri(world, NULL, plugin_file); FILE* plugin_fd = fopen(plugin_file, "a"); - lilv_plugin_write_description(world, p, base, plugin_fd); - fclose(plugin_fd); + if (plugin_fd) { + lilv_plugin_write_description(world, p, base, plugin_fd); + fclose(plugin_fd); + } else { + fprintf(stderr, "error: Failed to open %s\n", plugin_file); + } if (manifest_file) { FILE* manifest_fd = fopen(manifest_file, "a"); - lilv_plugin_write_manifest_entry( - world, p, base, manifest_fd, plugin_file); - fclose(manifest_fd); + if (manifest_fd) { + lilv_plugin_write_manifest_entry( + world, p, base, manifest_fd, plugin_file); + fclose(manifest_fd); + } else { + fprintf(stderr, "error: Failed to open %s\n", manifest_file); + } } lilv_node_free(base); } else if (p) { -- cgit v1.2.1