]> sjero.net Git - wget/commitdiff
[svn] Would abort when given invalid progress type.
authorhniksic <devnull@localhost>
Sun, 9 Dec 2001 22:25:34 +0000 (14:25 -0800)
committerhniksic <devnull@localhost>
Sun, 9 Dec 2001 22:25:34 +0000 (14:25 -0800)
Published in <sxsg06kxc9g.fsf@florida.arsdigita.de>.

src/ChangeLog
src/init.c

index 459a3b89985469a87f97445837cd3e1c91818306..20373dd2c58afe8f620d776a7a70fe667a63ac02 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-09  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * init.c (cmd_spec_progress): Resurrect.  Check whether VAL is a
+       valid progress type before setting it.
+
 2001-12-09  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * main.c (main): Remove stray debugging message.
index 2232291080fd60623420fe08478ae3db3d7b05d9..030abe9fe9bf4a90cb2cdbbabad03237f021c3a2 100644 (file)
@@ -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)