summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-05-15 18:23:24 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-05-15 18:23:24 +0200
commit06a90fa1c261c34922b3450bb32b0fcbf8c24d56 (patch)
tree195b59abb333cc534c86bf5cfec5d7752180d7c7
parent816032140813972e230863a002b4acd1b15d2bcf (diff)
Compilation fix when curses interface is missing
-rw-r--r--src/addpartn.c2
-rw-r--r--src/dirpart.c11
-rw-r--r--src/geometry.c3
-rw-r--r--src/geometryn.c4
-rw-r--r--src/pdisksel.c8
5 files changed, 16 insertions, 12 deletions
diff --git a/src/addpartn.c b/src/addpartn.c
index 948a361..4f4000f 100644
--- a/src/addpartn.c
+++ b/src/addpartn.c
@@ -24,6 +24,7 @@
#include <config.h>
#endif
+#ifdef HAVE_NCURSES
#include <stdio.h>
#include "types.h"
#include "common.h"
@@ -59,3 +60,4 @@ list_part_t *add_partition_ncurses(disk_t *disk, list_part_t *list_part)
return add_partition_xbox_ncurses(disk, list_part);
return list_part;
}
+#endif
diff --git a/src/dirpart.c b/src/dirpart.c
index d946da5..aa302e7 100644
--- a/src/dirpart.c
+++ b/src/dirpart.c
@@ -179,10 +179,13 @@ int dir_partition(disk_t *disk_car, const partition_t *partition, const int verb
dir_partition_aff(disk_car, partition, &dir_data, dir_data.current_inode, current_cmd);
#else
{
- file_data_t *dir_list;
- dir_list=dir_data.get_dir(disk_car, partition, &dir_data, dir_data.current_inode);
- dir_aff_log(&dir_data, dir_list);
- delete_list_file(dir_list);
+ file_info_t dir_list = {
+ .list = TD_LIST_HEAD_INIT(dir_list.list),
+ .name = NULL
+ };
+ dir_data.get_dir(disk_car, partition, &dir_data, dir_data.current_inode, &dir_list);
+ dir_aff_log(&dir_data, &dir_list);
+ delete_list_file(&dir_list);
}
#endif
}
diff --git a/src/geometry.c b/src/geometry.c
index 52eef51..baac0d6 100644
--- a/src/geometry.c
+++ b/src/geometry.c
@@ -33,9 +33,6 @@
#include "types.h"
#include "common.h"
#include "intrf.h"
-#ifdef HAVE_NCURSES
-#include "intrfn.h"
-#endif
#include "log.h"
#include "hdaccess.h"
#include "geometry.h"
diff --git a/src/geometryn.c b/src/geometryn.c
index c80c6b7..9b98f0d 100644
--- a/src/geometryn.c
+++ b/src/geometryn.c
@@ -23,6 +23,7 @@
#include <config.h>
#endif
+#ifdef HAVE_NCURSES
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -33,9 +34,7 @@
#include "types.h"
#include "common.h"
#include "intrf.h"
-#ifdef HAVE_NCURSES
#include "intrfn.h"
-#endif
#include "log.h"
#include "hdaccess.h"
#include "autoset.h"
@@ -186,3 +185,4 @@ int change_geometry_ncurses(disk_t *disk_car)
}
return 0;
}
+#endif
diff --git a/src/pdisksel.c b/src/pdisksel.c
index 684fd0f..da6feef 100644
--- a/src/pdisksel.c
+++ b/src/pdisksel.c
@@ -303,13 +303,16 @@ int do_curses_photorec(struct ph_param *params, struct ph_options *options, cons
static alloc_data_t list_search_space={
.list = TD_LIST_HEAD_INIT(list_search_space.list)
};
-#ifdef HAVE_NCURSES
if(params->cmd_device==NULL)
{
char *saved_device=NULL;
char *saved_cmd=NULL;
session_load(&saved_device, &saved_cmd,&list_search_space);
- if(saved_device!=NULL && saved_cmd!=NULL && !td_list_empty(&list_search_space.list) && ask_confirmation("Continue previous session ? (Y/N)")!=0)
+ if(saved_device!=NULL && saved_cmd!=NULL && !td_list_empty(&list_search_space.list)
+#ifdef HAVE_NCURSES
+ && ask_confirmation("Continue previous session ? (Y/N)")!=0
+#endif
+ )
{
/* yes */
params->cmd_run=saved_cmd;
@@ -322,7 +325,6 @@ int do_curses_photorec(struct ph_param *params, struct ph_options *options, cons
free_list_search_space(&list_search_space);
}
}
-#endif
if(params->cmd_device!=NULL && params->cmd_run!=NULL)
return photorec_disk_selection_cli(params, options, list_disk, &list_search_space);
#ifdef HAVE_NCURSES