summaryrefslogtreecommitdiffstats
path: root/src/fat_adv.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-04-19 08:22:59 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-04-19 08:22:59 +0200
commitcc3376dcad75de0aa4ca93880d0b747bbdb28ce5 (patch)
treed3065ba5f80fce4c4a7fedb2f8bac5a90ae68db5 /src/fat_adv.c
parent3babfb3deb5a81213f9b64517e1e7db1cf5f9ce0 (diff)
Add the possibility to stop (Quit) the FAT32 root cluster search
Diffstat (limited to 'src/fat_adv.c')
-rw-r--r--src/fat_adv.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/fat_adv.c b/src/fat_adv.c
index 67cb5a9..465d05d 100644
--- a/src/fat_adv.c
+++ b/src/fat_adv.c
@@ -195,7 +195,7 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
wmove(window,4,0);
aff_part(window,AFF_PART_ORDER|AFF_PART_STATUS,disk_car,partition);
wmove(window,6,0);
- wprintw(window,"Answer Y(es), N(o) or A(bort interactive mode). N or A if not sure.");
+ wprintw(window,"Answer Y(es), N(o), Q(uit) or A(bort interactive mode). N or A if not sure.");
curs_set(1);
do
{
@@ -251,6 +251,8 @@ static int ask_root_directory(disk_t *disk_car, const partition_t *partition, co
case 'Y':
case 'n':
case 'N':
+ case 'Q':
+ case 'q':
quit=1;
break;
}
@@ -519,6 +521,10 @@ static unsigned int fat32_find_root_cluster(disk_t *disk_car,const partition_t *
case 'A':
interactive=0;
break;
+ case 'Q':
+ delete_list_file(dir_list);
+ free(buffer);
+ return 0;
default:
break;
}
@@ -545,7 +551,7 @@ static unsigned int fat32_find_root_cluster(disk_t *disk_car,const partition_t *
{
dir_aff_log(NULL, rootdir_list);
#ifdef HAVE_NCURSES
- if(interface && (expert>0))
+ if(interface && expert>0)
{
if(ask_confirmation("Create a new root cluster with %u first-level directories (Expert only) (Y/N)",dir_nbr)!=0 && ask_confirmation("Write root cluster, confirm ? (Y/N)")!=0)
{
@@ -2160,6 +2166,12 @@ int rebuild_FAT_BS(disk_t *disk_car, partition_t *partition, const int verbose,
if(expert>0)
{
#ifdef HAVE_NCURSES
+ int i;
+ for(i=5; i<INTER_FAT_ASK_Y; i++)
+ {
+ wmove(stdscr, i, 0);
+ wclrtoeol(stdscr);
+ }
wmove(stdscr, INTER_FAT_ASK_Y, INTER_FAT_ASK_X);
root_cluster=ask_number(root_cluster,2,data_size/sectors_per_cluster+1,"root cluster ");
#endif