Do not use \r if output is not a terminal

This commit is contained in:
Vitaliy Filippov
2024-02-29 00:21:17 +03:00
parent 5af23672d0
commit 77167e2920
4 changed files with 23 additions and 7 deletions
+3 -1
View File
@@ -213,7 +213,9 @@ struct rm_inode_t
}
if (parent->progress && total_count > 0 && total_done*1000/total_count != total_prev_pct)
{
fprintf(stderr, "\rRemoved %ju/%ju objects, %ju more PGs to list...", total_done, total_count, pgs_to_list);
fprintf(stderr, parent->color
? "\rRemoved %ju/%ju objects, %ju more PGs to list..."
: "Removed %ju/%ju objects, %ju more PGs to list...\n", total_done, total_count, pgs_to_list);
total_prev_pct = total_done*1000/total_count;
}
if (lists_done && !lists.size())