From fb7fb36cb8a2cf7fb559f1875f63b0df0239411c Mon Sep 17 00:00:00 2001 From: hniksic Date: Tue, 27 Nov 2001 18:44:18 -0800 Subject: [PATCH] [svn] Resurrect opt.dot_style. --- src/ChangeLog | 12 ++++++++++++ src/init.c | 1 + src/main.c | 8 +------- src/options.h | 1 + src/progress.c | 7 ++++++- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4d25068d..0dea6fdd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2001-11-28 Hrvoje Niksic + + * progress.c (dot_set_params): If PARAMS is unspecified, use + dot_style, if available. + + * init.c: Ditto. + + * main.c (main): Resurect --dot-style. + + * progress.c (dot_finish): Print the quantity if we're left at the + beginning of a row. + 2001-11-27 Hrvoje Niksic * cmpt.c (random): Removed. diff --git a/src/init.c b/src/init.c index 2b1db499..8a76c17a 100644 --- a/src/init.c +++ b/src/init.c @@ -122,6 +122,7 @@ static struct { { "dotbytes", &opt.dot_bytes, cmd_bytes }, { "dotsinline", &opt.dots_in_line, cmd_number }, { "dotspacing", &opt.dot_spacing, cmd_number }, + { "dotstyle", &opt.dot_style, cmd_string }, { "excludedirectories", &opt.excludes, cmd_directory_vector }, { "excludedomains", &opt.exclude_domains, cmd_vector }, { "followftp", &opt.follow_ftp, cmd_boolean }, diff --git a/src/main.c b/src/main.c index f552ba6d..5dc9bb03 100644 --- a/src/main.c +++ b/src/main.c @@ -492,13 +492,7 @@ GNU General Public License for more details.\n")); setval ("header", optarg); break; case 134: - /* Supported for compatibility; --dot-style=foo equivalent - to --progress=dot:foo. */ - { - char *tmp = alloca (3 + 1 + strlen (optarg)); - sprintf (tmp, "dot:%s", optarg); - setval ("progress", tmp); - } + setval ("dotstyle", optarg); break; case 135: setval ("htmlify", optarg); diff --git a/src/options.h b/src/options.h index 92b812a4..fcbee704 100644 --- a/src/options.h +++ b/src/options.h @@ -139,6 +139,7 @@ struct options int htmlify; /* Do we HTML-ify the OS-dependent listings? */ + char *dot_style; long dot_bytes; /* How many bytes in a printing dot. */ int dots_in_line; /* How many dots in one line. */ diff --git a/src/progress.c b/src/progress.c index e932da36..18732c77 100644 --- a/src/progress.c +++ b/src/progress.c @@ -288,6 +288,8 @@ dot_finish (void *progress, long dltime) log_set_flush (0); + if (dp->dots == 0) + logprintf (LOG_VERBOSE, "\n%5ldK", dp->rows * row_bytes / 1024); for (i = dp->dots; i < opt.dots_in_line; i++) { if (i % opt.dot_spacing == 0) @@ -323,6 +325,9 @@ dot_finish (void *progress, long dltime) static void dot_set_params (const char *params) { + if (!params || !*params) + params = opt.dot_style; + if (!params) return; @@ -409,7 +414,7 @@ bar_create (long initial, long total) bp->width = screen_width; bp->buffer = xmalloc (bp->width + 1); - logputs (LOG_VERBOSE, "\n\n"); + logputs (LOG_VERBOSE, "\n"); create_image (bp, 0); display_image (bp->buffer); -- 2.39.2