diff options
author | David Robillard <d@drobilla.net> | 2014-05-05 15:38:33 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-05-05 15:38:33 +0000 |
commit | 6ac6d7448aa0a976e7347daf8b48d6e56216af85 (patch) | |
tree | 0f51f140d4f04ef160cc36ab91a5dbd3a5111940 /utils | |
parent | 88b95c5a431dfb2762309073184406d1eaa987bf (diff) | |
download | lilv-6ac6d7448aa0a976e7347daf8b48d6e56216af85.tar.gz lilv-6ac6d7448aa0a976e7347daf8b48d6e56216af85.tar.bz2 lilv-6ac6d7448aa0a976e7347daf8b48d6e56216af85.zip |
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
Diffstat (limited to 'utils')
-rw-r--r-- | utils/lv2info.c | 22 |
1 files changed, 15 insertions, 7 deletions
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 <http://drobilla.net> + Copyright 2007-2014 David Robillard <http://drobilla.net> 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) { |