@@ -207,11 +207,24 @@ progress_report(int tablespacenum, char *fn)
207
207
percent = 100 ;
208
208
209
209
if (verbose )
210
- fprintf (stderr ,
211
- INT64_FORMAT "/" INT64_FORMAT " kB (%i%%) %i/%i tablespaces (%-30s)\r" ,
212
- totaldone / 1024 , totalsize ,
213
- percent ,
214
- tablespacenum , tablespacecount , fn );
210
+ {
211
+ if (!fn )
212
+
213
+ /*
214
+ * No filename given, so clear the status line (used for last
215
+ * call)
216
+ */
217
+ fprintf (stderr ,
218
+ INT64_FORMAT "/" INT64_FORMAT " kB (100%%) %i/%i tablespaces %35s\r" ,
219
+ totaldone / 1024 , totalsize ,
220
+ tablespacenum , tablespacecount , "" );
221
+ else
222
+ fprintf (stderr ,
223
+ INT64_FORMAT "/" INT64_FORMAT " kB (%i%%) %i/%i tablespaces (%-30.30s)\r" ,
224
+ totaldone / 1024 , totalsize ,
225
+ percent ,
226
+ tablespacenum , tablespacecount , fn );
227
+ }
215
228
else
216
229
fprintf (stderr , INT64_FORMAT "/" INT64_FORMAT " kB (%i%%) %i/%i tablespaces\r" ,
217
230
totaldone / 1024 , totalsize ,
@@ -871,7 +884,7 @@ BaseBackup()
871
884
872
885
if (showprogress )
873
886
{
874
- progress_report (PQntuples (res ), "" );
887
+ progress_report (PQntuples (res ), NULL );
875
888
fprintf (stderr , "\n" ); /* Need to move to next line */
876
889
}
877
890
PQclear (res );
0 commit comments