| 363 | } |
| 364 | |
| 365 | static void adv_menu_image_selected(disk_t *disk, const partition_t *partition, char **current_cmd) |
| 366 | { |
| 367 | char dst_path[4096]; |
| 368 | dst_path[0]='\0'; |
| 369 | #ifdef HAVE_NCURSES |
| 370 | if(*current_cmd!=NULL) |
| 371 | td_getcwd(dst_path, sizeof(dst_path)); |
| 372 | else |
| 373 | { |
| 374 | char msg[256]; |
| 375 | snprintf(msg, sizeof(msg), |
| 376 | "Please select where to store the file image.dd (%u MB), an image of the partition", |
| 377 | (unsigned int)(partition->part_size/1000/1000)); |
| 378 | ask_location(dst_path, sizeof(dst_path), msg, ""); |
| 379 | } |
| 380 | #else |
| 381 | td_getcwd(&dst_path, sizeof(dst_path)); |
| 382 | #endif |
| 383 | if(dst_path[0]!='\0') |
| 384 | { |
| 385 | char *filename=(char *)MALLOC(strlen(dst_path) + 1 + strlen(DEFAULT_IMAGE_NAME) + 1); |
| 386 | strcpy(filename, dst_path); |
| 387 | strcat(filename, "/"); |
| 388 | strcat(filename, DEFAULT_IMAGE_NAME); |
| 389 | disk_image(disk, partition, filename); |
| 390 | free(filename); |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | static void adv_menu_undelete_selected(disk_t *disk, const partition_t *partition, const int verbose, char **current_cmd) |
| 395 | { |
no test coverage detected