From 0db305126bd05f0739d83d36634772cf44851a65 Mon Sep 17 00:00:00 2001 From: Daniel Manrique Date: Sat, 23 Apr 2011 15:31:41 -0400 Subject: [PATCH] Set exit status when invalid host given --- src/ChangeLog | 6 ++++++ src/html-url.c | 1 + src/main.c | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0a16c79f..8b74216d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-04-21 Daniel Manrique + * main.c (main): Set exit status when invalid host name given in + command line. + * html-url.c (get_urls_file): Set exit status when invalid host + name given in input file. + 2011-04-19 Giuseppe Scrivano * gnutls.c: Do not include . diff --git a/src/html-url.c b/src/html-url.c index 287b2f54..c7c3e39a 100644 --- a/src/html-url.c +++ b/src/html-url.c @@ -810,6 +810,7 @@ get_urls_file (const char *file) file, url_text, error); xfree (url_text); xfree (error); + inform_exit_status (URLERROR); continue; } xfree (url_text); diff --git a/src/main.c b/src/main.c index 80ecc3dd..3a052503 100644 --- a/src/main.c +++ b/src/main.c @@ -1347,6 +1347,7 @@ outputting to a regular file.\n")); char *error = url_error (*t, url_err); logprintf (LOG_NOTQUIET, "%s: %s.\n",*t, error); xfree (error); + inform_exit_status (URLERROR); } else { @@ -1387,7 +1388,9 @@ outputting to a regular file.\n")); if (opt.input_filename) { int count; - retrieve_from_file (opt.input_filename, opt.force_html, &count); + int status; + status = retrieve_from_file (opt.input_filename, opt.force_html, &count); + inform_exit_status (status); if (!count) logprintf (LOG_NOTQUIET, _("No URLs found in %s.\n"), opt.input_filename); -- 2.39.2