summaryrefslogtreecommitdiffstats
path: root/src/dirn.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-01-27 08:42:14 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2012-01-27 08:42:14 +0100
commitd256adb14719ae0b31890da4bcad312021882022 (patch)
tree9f6e3f91480b32beaf7022b32bc9842a7be5de90 /src/dirn.c
parent9998392d2127737982e10c01a515649328329196 (diff)
move ask_int_ncurses() and ask_string_ncurses() to src/intrfn.c
add a minimalist find in file listing
Diffstat (limited to 'src/dirn.c')
-rw-r--r--src/dirn.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/dirn.c b/src/dirn.c
index 2d33f09..f4c7a1d 100644
--- a/src/dirn.c
+++ b/src/dirn.c
@@ -467,6 +467,26 @@ static long int dir_aff_ncurses(disk_t *disk, const partition_t *partition, dir_
}
}
break;
+ case 'f':
+ {
+ const char *needle=ask_string_ncurses("Filename to find ? ");
+ if(needle!=NULL && needle[0]!='\0')
+ {
+ file_data_t *pos_org=pos;
+ const int pos_num_org=pos_num;
+ while(strcmp(pos->name, needle)!=0 && pos->next!=NULL)
+ {
+ pos=pos->next;
+ pos_num++;
+ }
+ if(strcmp(pos->name, needle)!=0)
+ {
+ pos=pos_org;
+ pos_num=pos_num_org;
+ }
+ }
+ }
+ break;
}
if(pos_num<offset)
offset=pos_num;