From 4f91014e3fc02c359ea53506a34387adae86a60e Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 23 Nov 2001 08:24:06 -0800 Subject: [PATCH] [svn] Allow the user to force bar progress. Published in . --- src/ChangeLog | 5 +++++ src/progress.c | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cf9ba8d4..070aa957 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-11-23 Hrvoje Niksic + + * progress.c (bar_set_params): Allow the user to force the use of + the bar. + 2001-11-23 Lemble Gregory * gen_sslfunc.c (ssl_init_prng): New function; seed the SSL RNG. diff --git a/src/progress.c b/src/progress.c index 1e278598..6c721cda 100644 --- a/src/progress.c +++ b/src/progress.c @@ -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; }