summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-04-21 14:20:50 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-04-21 14:20:50 +0200
commit8140cb4898c9d52bd4e90b363d39c5db70fc7910 (patch)
tree1d9eefd7ce9d794a85efcb366562353614f1cff7
parent3fc3a690fcfe81e1d7d716d5a6e3d2553f5bd747 (diff)
"testdisk -l" will list the partition info if available
-rw-r--r--src/intrface.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/intrface.c b/src/intrface.c
index 043e8e9..ff273dc 100644
--- a/src/intrface.c
+++ b/src/intrface.c
@@ -50,18 +50,28 @@
extern const arch_fnct_t arch_none;
-void interface_list(disk_t *disk_car, const int verbose, const int saveheader, const int backup)
+void interface_list(disk_t *disk, const int verbose, const int saveheader, const int backup)
{
list_part_t *list_part;
+ list_part_t *parts;
log_info("\nAnalyse ");
- log_info("%s\n",disk_car->description(disk_car));
- printf("%s\n",disk_car->description(disk_car));
+ log_info("%s\n", disk->description(disk));
+ printf("%s\n", disk->description(disk));
printf(msg_PART_HEADER_LONG);
- list_part=disk_car->arch->read_part(disk_car,verbose,saveheader);
- screen_buffer_to_stdout();
+ list_part=disk->arch->read_part(disk,verbose,saveheader);
+
+ for(parts=list_part; parts!=NULL; parts=parts->next)
+ {
+ const char *msg;
+ const partition_t *partition=parts->part;
+ msg=aff_part_aux(AFF_PART_ORDER|AFF_PART_STATUS, disk, partition);
+ printf("%s\n", msg);
+ if(partition->info[0]!='\0')
+ printf(" %s\n", partition->info);
+ }
if(backup>0)
{
- partition_save(disk_car,list_part,verbose);
+ partition_save(disk, list_part, verbose);
}
part_free_list(list_part);
}