summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <[email protected]>2024-01-30 20:42:16 +0100
committerChristophe Grenier <[email protected]>2024-01-30 20:42:16 +0100
commit097a76f1d3865b861f29e2508d3917856026cf78 (patch)
tree5b89b73fdc0368fe20d8c0772a1bbb7e33f00f5d
parent4efd6de3bcc536f5d9490fbbf315e3effea52dd7 (diff)
TestDisk: when searching for partition, press '+' to skip 5% of the disk
-rw-r--r--src/godmode.c10
-rw-r--r--src/intrfn.c2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/godmode.c b/src/godmode.c
index f3f539e6..7e089239 100644
--- a/src/godmode.c
+++ b/src/godmode.c
@@ -530,7 +530,7 @@ static void search_NTFS_from_backup(disk_t *disk_car, list_part_t *list_part, co
free(buffer_disk);
}
-typedef enum { INDSTOP_CONTINUE=0, INDSTOP_STOP=1, INDSTOP_SKIP=2, INDSTOP_QUIT=3 } indstop_t;
+typedef enum { INDSTOP_CONTINUE=0, INDSTOP_STOP=1, INDSTOP_SKIP=2, INDSTOP_QUIT=3, INDSTOP_PLUS=4 } indstop_t;
static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_org, const int verbose, const int dump_ind, const int fast_mode, char **current_cmd)
{
@@ -629,6 +629,9 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
case 2:
ind_stop=INDSTOP_SKIP;
break;
+ case 3:
+ ind_stop=INDSTOP_PLUS;
+ break;
}
}
#endif
@@ -943,6 +946,11 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
if(try_offset_nbr>0 && search_location < try_offset[0])
search_location=try_offset[0];
}
+ else if(ind_stop==INDSTOP_PLUS)
+ {
+ ind_stop=INDSTOP_CONTINUE;
+ search_location += search_location_max / 20 / (1024 * 1024) * (1024 * 1014);
+ }
else if(ind_stop==INDSTOP_STOP)
{
if(try_offset_nbr>0 && search_location < try_offset[0])
diff --git a/src/intrfn.c b/src/intrfn.c
index 1c5d45bd..3fe43fb2 100644
--- a/src/intrfn.c
+++ b/src/intrfn.c
@@ -1142,6 +1142,8 @@ int check_enter_key_or_s(WINDOW *window)
return 1;
case 'F':
return 2;
+ case '+':
+ return 3;
}
return 0;
}