summaryrefslogtreecommitdiffstats
path: root/src/tntfs.c
diff options
context:
space:
mode:
authorMatthew Howle <mdhowle@gmail.com>2015-09-02 10:52:45 -0400
committerMatthew Howle <mdhowle@gmail.com>2015-09-02 11:46:34 -0400
commit3bc4720529726414baceda510627f5b1e79a29d8 (patch)
tree90ccc90694642481575aa7f520ea317a43221720 /src/tntfs.c
parenteb1fb3f0aff0a57ab82bf9dc3f4c06c09ce09e6f (diff)
Add noconfirm command to NTFS advance boot menu
Diffstat (limited to 'src/tntfs.c')
-rw-r--r--src/tntfs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tntfs.c b/src/tntfs.c
index a9f1079..a682659 100644
--- a/src/tntfs.c
+++ b/src/tntfs.c
@@ -92,6 +92,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
{ 0, NULL, NULL }
};
#endif
+ int no_confirm = 0;
buffer_bs=(unsigned char*)MALLOC(NTFS_BOOT_SECTOR_SIZE);
buffer_backup_bs=(unsigned char*)MALLOC(NTFS_BOOT_SECTOR_SIZE);
@@ -222,6 +223,11 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
if(strchr(options,'M')!=NULL)
command='M';
}
+ else if(strncmp(*current_cmd,"noconfirm",9)==0)
+ {
+ (*current_cmd)+=9;
+ no_confirm = 1;
+ }
}
else
{
@@ -240,7 +246,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
return 0;
case 'O': /* O : copy original boot sector over backup boot */
#ifdef HAVE_NCURSES
- if(ask_confirmation("Copy original NTFS boot sector over backup boot, confirm ? (Y/N)")!=0)
+ if(no_confirm == 1 || ask_confirmation("Copy original NTFS boot sector over backup boot, confirm ? (Y/N)")!=0)
{
log_info("copy original boot sector over backup boot\n");
if(disk_car->pwrite(disk_car, buffer_bs, NTFS_BOOT_SECTOR_SIZE, partition->part_offset + partition->part_size - disk_car->sector_size) != NTFS_BOOT_SECTOR_SIZE)
@@ -253,7 +259,7 @@ int ntfs_boot_sector(disk_t *disk_car, partition_t *partition, const int verbose
break;
case 'B': /* B : copy backup boot sector over boot sector */
#ifdef HAVE_NCURSES
- if(ask_confirmation("Copy backup NTFS boot sector over boot sector, confirm ? (Y/N)")!=0)
+ if(no_confirm == 1 || ask_confirmation("Copy backup NTFS boot sector over boot sector, confirm ? (Y/N)")!=0)
{
log_info("copy backup boot sector over boot sector\n");
/* Reset information about backup boot sector */