summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pdiskseln.c4
-rw-r--r--src/phmain.c6
-rw-r--r--src/tdisksel.c4
3 files changed, 13 insertions, 1 deletions
diff --git a/src/pdiskseln.c b/src/pdiskseln.c
index 3b1c39d..a396e49 100644
--- a/src/pdiskseln.c
+++ b/src/pdiskseln.c
@@ -74,7 +74,9 @@ static int photorec_disk_selection_ncurses(struct ph_param *params, struct ph_op
unsigned int menu=0;
int offset=0;
int pos_num=0;
+#ifdef SUDO_BIN
int use_sudo=0;
+#endif
const list_disk_t *element_disk;
const list_disk_t *current_disk=list_disk;
static const struct MenuItem menuMain[]=
@@ -149,6 +151,7 @@ static int photorec_disk_selection_ncurses(struct ph_param *params, struct ph_op
wmove(stdscr, INTER_NOTE_Y+3, 0);
wprintw(stdscr,"detection, and install the latest OS patches and disk drivers.");
}
+#ifdef SUDO_BIN
if(use_sudo > 0)
{
if(i<=NBR_DISK_MAX && element_disk==NULL)
@@ -157,6 +160,7 @@ static int photorec_disk_selection_ncurses(struct ph_param *params, struct ph_op
menu_options="PNOSQ";
}
else
+#endif
{
if(i<=NBR_DISK_MAX && element_disk==NULL)
menu_options="OQ";
diff --git a/src/phmain.c b/src/phmain.c
index 3bc72cf..a634490 100644
--- a/src/phmain.c
+++ b/src/phmain.c
@@ -125,7 +125,9 @@ static void display_version(void)
int main( int argc, char **argv )
{
int i;
+#ifdef SUDO_BIN
int use_sudo=0;
+#endif
int create_log=TD_LOG_NONE;
int run_setlocale=1;
int testdisk_mode=TESTDISK_O_RDONLY|TESTDISK_O_READAHEAD_32K;
@@ -359,9 +361,11 @@ int main( int argc, char **argv )
#endif
#endif
}
-#endif
if(use_sudo==0)
use_sudo=do_curses_photorec(&params, &options, list_disk);
+#else
+ do_curses_photorec(&params, &options, list_disk);
+#endif
#ifdef HAVE_NCURSES
end_ncurses();
#endif
diff --git a/src/tdisksel.c b/src/tdisksel.c
index b95e296..14170ad 100644
--- a/src/tdisksel.c
+++ b/src/tdisksel.c
@@ -62,7 +62,9 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
unsigned int menu=0;
int offset=0;
int pos_num=0;
+#ifdef SUDO_BIN
int use_sudo=0;
+#endif
const list_disk_t *element_disk;
const list_disk_t *current_disk;
static const struct MenuItem menuMain[]=
@@ -134,6 +136,7 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
wmove(stdscr,line,0);
wprintw(stdscr,"detection, and install the latest OS patches and disk drivers.");
}
+#ifdef SUDO_BIN
if(use_sudo > 0)
{
if(i<=NBR_DISK_MAX && element_disk==NULL)
@@ -142,6 +145,7 @@ static int testdisk_disk_selection_ncurses(int verbose,int dump_ind, const list_
options="PNOSQ";
}
else
+#endif
{
if(i<=NBR_DISK_MAX && element_disk==NULL)
options="OQ";