added the --safe-links option to disallow symlinks outside the
[rsync/rsync.git] / util.c
diff --git a/util.c b/util.c
index 639a4a4..15ab69d 100644 (file)
--- a/util.c
+++ b/util.c
@@ -685,3 +685,28 @@ int u_strcmp(const char *cs1, const char *cs2)
        
        return (int)*s1 - (int)*s2;
 }
+
+static OFF_T last_ofs;
+
+void end_progress(void)
+{
+       extern int do_progress, am_server;
+
+       if (do_progress && !am_server) {
+               rprintf(FINFO,"\n");
+       }
+       last_ofs = 0;
+}
+
+void show_progress(OFF_T ofs, OFF_T size)
+{
+       extern int do_progress, am_server;
+
+       if (do_progress && !am_server) {
+               if (ofs > last_ofs + 1000) {
+                       int pct = (int)((100.0*ofs)/size);
+                       rprintf(FINFO,"%.0f (%d%%)\r", (double)ofs, pct);
+                       last_ofs = ofs;
+               }
+       }
+}