summaryrefslogtreecommitdiffstats
path: root/src/qpsearch.cpp
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-10-11 10:25:21 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-10-11 10:25:21 +0200
commit82ae16950233a3d00cec78c3dbce84a3b10eef32 (patch)
tree023f8647b07b007444ae42b9d603a9319941fc06 /src/qpsearch.cpp
parent8c6524a0434cadc2e8b22556b5f944279d40de97 (diff)
QPhotoRec: update to use get_prev_location_smart() like photorec does
Diffstat (limited to 'src/qpsearch.cpp')
-rw-r--r--src/qpsearch.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qpsearch.cpp b/src/qpsearch.cpp
index 39307e8..9b0d258 100644
--- a/src/qpsearch.cpp
+++ b/src/qpsearch.cpp
@@ -331,7 +331,7 @@ pstatus_t QPhotorec::photorec_aux(alloc_data_t *list_search_space)
log_info("PhotoRec has been stopped\n");
current_search_space=list_search_space;
}
- else if(file_recovered==0)
+ else if(file_recovered==PFSTATUS_BAD)
{
if(res==DC_SCAN)
{
@@ -340,15 +340,19 @@ pstatus_t QPhotorec::photorec_aux(alloc_data_t *list_search_space)
back=0;
}
}
- else if(file_recovered>0)
+ else if(file_recovered==PFSTATUS_OK_TRUNCATED ||
+ (file_recovered==PFSTATUS_OK && file_recovery.file_stat==NULL))
{
/* try to recover the previous file, otherwise stay at the current location */
offset_before_back=offset;
- if(back < 10 &&
+ if(back < 5 &&
get_prev_file_header(list_search_space, &current_search_space, &offset)==0)
back++;
else
+ {
back=0;
+ get_prev_location_smart(list_search_space, &current_search_space, &offset, file_recovery.location.start);
+ }
}
if(current_search_space==list_search_space)
{