aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-01-09 12:25:14 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-01-09 12:25:14 +0000
commitb137d5ec237f08359ecda08513f77525ce045140 (patch)
treec503859deb587e413aafb8833f82e51b5ecd5d09 /src
parent4792eee5d06902e28ffe7679d1bd964877aa39aa (diff)
bugfix for when more -o than URLs is used
Diffstat (limited to 'src')
-rw-r--r--src/main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 47087754a..a4685acf5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1532,9 +1532,21 @@ operate(struct Configurable *config, int argc, char *argv[])
/* loop through the list of given URLs */
while(urlnode) {
- /* get the full URL */
+ /* get the full URL (it might be NULL) */
url=urlnode->url;
+ if(NULL == url) {
+ /* This node had no URL, skip it and continue to the next */
+ if(urlnode->outfile)
+ free(urlnode->outfile);
+
+ /* move on to the next URL */
+ nextnode=urlnode->next;
+ free(urlnode); /* free the node */
+ urlnode = nextnode;
+ continue; /* next please */
+ }
+
/* default output stream is stdout */
outs.stream = stdout;
outs.config = config;