summaryrefslogtreecommitdiffstats
path: root/src/dirn.c
diff options
context:
space:
mode:
authorAndrei GUDIU <andreig@openbsd-box.org>2015-03-12 08:26:58 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2015-03-12 08:26:58 +0100
commitca0f2852732c188fc76b2a2cb149295342e6216d (patch)
tree793ffa0db66b3e106dd8247499f529ea9f2ff06c /src/dirn.c
parent66acdf8ff00eec00063e1b47f496665b25c55ece (diff)
File listing: use 'F' key to mark all files matching a user-specified filter.
This way it's easier to copy them.
Diffstat (limited to 'src/dirn.c')
-rw-r--r--src/dirn.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/dirn.c b/src/dirn.c
index 96f5f2f..ce9a0ef 100644
--- a/src/dirn.c
+++ b/src/dirn.c
@@ -517,6 +517,24 @@ static long int dir_aff_ncurses(disk_t *disk, const partition_t *partition, dir_
}
}
break;
+ case 'F':
+ {
+ const char *needle=ask_string_ncurses("Filter ? ");
+ if(needle!=NULL && needle[0]!='\0')
+ {
+ struct td_list_head *tmpw= NULL;
+ td_list_for_each(tmpw, &dir_list->list)
+ {
+ file_info_t *tmp=td_list_entry(tmpw, file_info_t, list);
+ if(strcasestr(tmp->name, needle) != NULL)
+ {
+ tmp->status^=FILE_STATUS_MARKED;
+ }
+ }
+ }
+ status^=FILE_STATUS_MARKED;
+ }
+ break;
}
if(pos_num<offset)
offset=pos_num;