summaryrefslogtreecommitdiffstats
path: root/src/phnc.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-06-02 20:53:27 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-06-02 20:53:27 +0200
commite0d5e35d6b15ae0e5a55252d6d8af09472e3b0c1 (patch)
tree18af714b226e2533ab4f4d6348decd848c4032b4 /src/phnc.c
parent0371a41375680c584c332524032441d47710f6ab (diff)
PhotoRec: workaroud in progress bar when time goes backward
Diffstat (limited to 'src/phnc.c')
-rw-r--r--src/phnc.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/phnc.c b/src/phnc.c
index ec60777..8d66706 100644
--- a/src/phnc.c
+++ b/src/phnc.c
@@ -104,16 +104,19 @@ int photorec_progressbar(WINDOW *window, const unsigned int pass, const photorec
}
wmove(window,10,0);
wclrtoeol(window);
- wprintw(window,"Elapsed time %uh%02um%02us",
- (unsigned)(elapsed_time/60/60),
- (unsigned)(elapsed_time/60%60),
- (unsigned)(elapsed_time%60));
- if(offset-partition->part_offset!=0 && (status!=STATUS_EXT2_ON_BF && status!=STATUS_EXT2_OFF_BF))
+ if(elapsed_time>0)
{
- wprintw(window," - Estimated time to completion %uh%02um%02u\n",
- (unsigned)((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset)/3600),
- (unsigned)(((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset)/60)%60),
- (unsigned)((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset))%60);
+ wprintw(window,"Elapsed time %uh%02um%02us",
+ (unsigned)(elapsed_time/60/60),
+ (unsigned)(elapsed_time/60%60),
+ (unsigned)(elapsed_time%60));
+ if(offset > partition->part_offset && status!=STATUS_EXT2_ON_BF && status!=STATUS_EXT2_OFF_BF)
+ {
+ wprintw(window," - Estimated time to completion %uh%02um%02u\n",
+ (unsigned)((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset)/3600),
+ (unsigned)(((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset)/60)%60),
+ (unsigned)((partition->part_offset+partition->part_size-1-offset)*elapsed_time/(offset-partition->part_offset))%60);
+ }
}
photorec_info(window, file_stats);
wrefresh(window);