From 233fcbc44daa5b103967fbb9a580e1c654c780cf Mon Sep 17 00:00:00 2001 From: hniksic Date: Sun, 9 Dec 2001 14:25:34 -0800 Subject: [PATCH] [svn] Would abort when given invalid progress type. Published in . --- src/ChangeLog | 5 +++++ src/init.c | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 459a3b89..20373dd2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-09 Hrvoje Niksic + + * init.c (cmd_spec_progress): Resurrect. Check whether VAL is a + valid progress type before setting it. + 2001-12-09 Hrvoje Niksic * main.c (main): Remove stray debugging message. diff --git a/src/init.c b/src/init.c index 22322910..030abe9f 100644 --- a/src/init.c +++ b/src/init.c @@ -54,6 +54,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "recur.h" #include "netrc.h" #include "cookies.h" /* for cookies_cleanup */ +#include "progress.h" #ifndef errno extern int errno; @@ -85,7 +86,7 @@ CMD_DECLARE (cmd_spec_dirstruct); CMD_DECLARE (cmd_spec_header); CMD_DECLARE (cmd_spec_htmlify); CMD_DECLARE (cmd_spec_mirror); -/*CMD_DECLARE (cmd_spec_progress);*/ +CMD_DECLARE (cmd_spec_progress); CMD_DECLARE (cmd_spec_recursive); CMD_DECLARE (cmd_spec_useragent); @@ -157,7 +158,7 @@ static struct { { "pagerequisites", &opt.page_requisites, cmd_boolean }, { "passiveftp", &opt.ftp_pasv, cmd_lockable_boolean }, { "passwd", &opt.ftp_pass, cmd_string }, - { "progress", &opt.progress_type, cmd_string }, + { "progress", &opt.progress_type, cmd_spec_progress }, { "proxypasswd", &opt.proxy_passwd, cmd_string }, { "proxyuser", &opt.proxy_user, cmd_string }, { "quiet", &opt.quiet, cmd_boolean }, @@ -940,7 +941,6 @@ cmd_spec_mirror (const char *com, const char *val, void *closure) return 1; } -#if 0 static int cmd_spec_progress (const char *com, const char *val, void *closure) { @@ -950,10 +950,13 @@ cmd_spec_progress (const char *com, const char *val, void *closure) exec_name, com, val); return 0; } - set_progress_implementation (val); + FREE_MAYBE (opt.progress_type); + + /* Don't call set_progress_implementation here. It will be called + in main() when it becomes clear what the log output is. */ + opt.progress_type = xstrdup (val); return 1; } -#endif static int cmd_spec_recursive (const char *com, const char *val, void *closure)