]> sjero.net Git - wget/commitdiff
[svn] Allow the user to force bar progress.
authorhniksic <devnull@localhost>
Fri, 23 Nov 2001 16:24:06 +0000 (08:24 -0800)
committerhniksic <devnull@localhost>
Fri, 23 Nov 2001 16:24:06 +0000 (08:24 -0800)
Published in <sxs8zcxh2x5.fsf@florida.arsdigita.de>.

src/ChangeLog
src/progress.c

index cf9ba8d4caf58aace1b8605a093efaf80e5fc4c8..070aa957f84c698271094f46f9d85d9a291aa75e 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-23  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * progress.c (bar_set_params): Allow the user to force the use of
+       the bar.
+
 2001-11-23  Lemble Gregory  <gregory.lemble@st.com>
 
        * gen_sslfunc.c (ssl_init_prng): New function; seed the SSL RNG.
index 1e278598432b9888511c2720629f0bdaa621d2ef..6c721cda902e4baf651c08016d2d74c5d510cffd 100644 (file)
@@ -592,20 +592,25 @@ display_image (char *buf)
 }
 
 static void
-bar_set_params (const char *ignored)
+bar_set_params (const char *params)
 {
   int sw;
 
-  if (opt.lfilename
+  if ((opt.lfilename
 #ifdef HAVE_ISATTY
-      || !isatty (fileno (stderr))
+       || !isatty (fileno (stderr))
 #else
-      1
+       1
 #endif
-      )
+       )
+      && !(params != NULL
+          && 0 == strcmp (params, "force")))
     {
-      /* We're not printing to a TTY.  Revert to the fallback
-        display. */
+      /* We're not printing to a TTY, so revert to the fallback
+        display.  #### We're recursively calling
+        set_progress_implementation here, which is slightly kludgy.
+        It would be nicer if that function could resolve this problem
+        itself.  */
       set_progress_implementation (NULL);
       return;
     }