patch from David Murn to make sure the final 100% is always printed
authorAndrew Tridgell <tridge@samba.org>
Tue, 25 Jan 2000 06:39:33 +0000 (06:39 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 25 Jan 2000 06:39:33 +0000 (06:39 +0000)
when using --progress

match.c
receiver.c
util.c

diff --git a/match.c b/match.c
index 86a04bed1546964437562836b1005aad0bbe45ec..1c0e894fa01339cdcb72caa22deac1401e12985c 100644 (file)
--- a/match.c
+++ b/match.c
@@ -122,7 +122,7 @@ static void matched(int f,struct sum_struct *s,struct map_struct *buf,
        if (buf)
                show_progress(last_match, buf->file_size);
 
-       if (i == -1) end_progress();
+       if (i == -1) end_progress(buf->file_size);
 }
 
 
index bf0877b3ee18d8a82ae314c065944e02e45d9c57..b9199f2be57ed8838ad8c3aa30ef37daed5f892f 100644 (file)
@@ -269,7 +269,7 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname,
                offset += len;
        }
 
-       end_progress();
+       end_progress(total_size);
 
        if (fd != -1 && offset > 0 && sparse_end(fd) != 0) {
                rprintf(FERROR,"write failed on %s : %s\n",
diff --git a/util.c b/util.c
index 078d59f5a2800288d6e8cf8b0247dea2cb33f792..4382300e4f46d628f5a259990214d44f9f3e314b 100644 (file)
--- a/util.c
+++ b/util.c
@@ -767,12 +767,12 @@ int u_strcmp(const char *cs1, const char *cs2)
 
 static OFF_T last_ofs;
 
-void end_progress(void)
+void end_progress(OFF_T size)
 {
        extern int do_progress, am_server;
 
        if (do_progress && !am_server) {
-               rprintf(FINFO,"\n");
+               rprintf(FINFO,"%.0f (100%%)\n", (double)size);
        }
        last_ofs = 0;
 }