summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/adv.c5
-rw-r--r--src/intrf.c11
-rw-r--r--src/intrf.h1
3 files changed, 13 insertions, 4 deletions
diff --git a/src/adv.c b/src/adv.c
index 497710b..33185f2 100644
--- a/src/adv.c
+++ b/src/adv.c
@@ -460,7 +460,10 @@ void interface_adv(disk_t *disk_car, const int verbose,const int dump_ind, const
{
char *image_dd;
menu=0;
- image_dd=ask_location("Do you want to save disk file image.dd in %s%s ? [Y/N]","");
+ if(*current_cmd!=NULL)
+ image_dd=get_default_location();
+ else
+ image_dd=ask_location("Do you want to save disk file image.dd in %s%s ? [Y/N]","");
if(image_dd!=NULL)
{
char *new_recup_dir=(char *)MALLOC(strlen(image_dd)+1+strlen(DEFAULT_IMAGE_NAME)+1);
diff --git a/src/intrf.c b/src/intrf.c
index 1b953b6..39aeb4d 100644
--- a/src/intrf.c
+++ b/src/intrf.c
@@ -288,6 +288,13 @@ static inline char *td_getcwd(char *buf, unsigned long size)
return buf;
}
+char *get_default_location(void)
+{
+ char dst_directory[4096];
+ td_getcwd(dst_directory, sizeof(dst_directory));
+ return strdup(dst_directory);
+}
+
#ifdef HAVE_NCURSES
#define INTER_DIR (LINES-25+16)
static int vaff_txt(int line, WINDOW *window, const char *_format, va_list ap) __attribute__((format(printf, 3, 0)));
@@ -1926,9 +1933,7 @@ int ask_confirmation(const char*_format, ...)
char *ask_location(const char*msg, const char *src_dir)
{
- char dst_directory[4096];
- td_getcwd(dst_directory, sizeof(dst_directory));
- return strdup(dst_directory);
+ return get_default_location();
}
#endif
diff --git a/src/intrf.h b/src/intrf.h
index 4a05fd4..dc57d3a 100644
--- a/src/intrf.h
+++ b/src/intrf.h
@@ -86,4 +86,5 @@ int interface_partition_type(disk_t *disk_car, const int verbose, char**current_
int intrf_no_disk(const char *prog_name);
char *ask_log_location(const char*filename);
char *ask_location(const char*msg, const char *src_dir);
+char *get_default_location(void);
void dump_ncurses(const void *nom_dump, unsigned int lng);