summaryrefslogtreecommitdiffstats
path: root/src/partauto.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-01-27 08:38:17 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2012-01-27 08:38:17 +0100
commit9998392d2127737982e10c01a515649328329196 (patch)
tree824f9aa0fa0926739cfbb70400bd690f9d7fd388 /src/partauto.c
parent130c0373d3f4cbc7a21bf9381aef4543814bbcf2 (diff)
TestDisk: display the partition table type if autodetected
Diffstat (limited to 'src/partauto.c')
-rw-r--r--src/partauto.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/partauto.c b/src/partauto.c
index e081743..8f0686d 100644
--- a/src/partauto.c
+++ b/src/partauto.c
@@ -93,11 +93,19 @@ void autodetect_arch(disk_t *disk)
disk->arch=&arch_mac;
list_part=disk->arch->read_part(disk,verbose,0);
}
- if(list_part==NULL)
- disk->arch=arch;
- part_free_list(list_part);
#ifndef DEBUG_PARTAUTO
log_set_levels(old_levels);
#endif
- log_info("Partition table type (auto): %s\n", disk->arch->part_name);
+ if(list_part!=NULL)
+ {
+ disk->arch_autodetected=disk->arch;
+ log_info("Partition table type (auto): %s\n", disk->arch->part_name);
+ }
+ else
+ {
+ disk->arch_autodetected=NULL;
+ disk->arch=arch;
+ log_info("Partition table type default to %s\n", arch->part_name);
+ }
+ part_free_list(list_part);
}