aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tool_metalink.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index b442fc0d7..d31502ab2 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -94,6 +94,10 @@ int parse_metalink(struct Configurable *config, const char *infile)
if(r != 0) {
return -1;
}
+ if(metalink->files == NULL) {
+ fprintf(config->errors, "\nMetalink does not contain any file.\n");
+ return 0;
+ }
ml = new_metalink(metalink);
if(config->metalink_list) {
@@ -107,7 +111,11 @@ int parse_metalink(struct Configurable *config, const char *infile)
for(files = metalink->files; *files; ++files) {
struct getout *url;
/* Skip an entry which has no resource. */
- if(!(*files)->resources[0]) continue;
+ if(!(*files)->resources) {
+ fprintf(config->errors, "\nFile %s does not have any resource.\n",
+ (*files)->name);
+ continue;
+ }
if(config->url_get ||
((config->url_get = config->url_list) != NULL)) {
/* there's a node here, if it already is filled-in continue to