Fixed Select/Unselect file mask. now mask applied to entire filename, not to part of filename

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2009-06-10 11:57:45 +03:00
parent b2a680b768
commit dbb953bfbe
3 changed files with 11 additions and 2 deletions

View File

@ -528,9 +528,9 @@ select_unselect_cmd (const char *title, const char *history_name, gboolean do_se
g_free (reg_exp);
return;
}
search = mc_search_new (reg_exp, -1);
search->search_type = MC_SEARCH_T_GLOB;
search->is_entire_line = TRUE;
search->is_case_sentitive = case_sens != 0;
for (i = 0; i < current_panel->count; i++) {

View File

@ -115,9 +115,15 @@ void
mc_search__cond_struct_new_init_glob (const char *charset, mc_search_t * mc_search,
mc_search_cond_t * mc_search_cond)
{
GString *tmp = mc_search__glob_translate_to_regex (mc_search_cond->str->str, &mc_search_cond->len);
GString *tmp =
mc_search__glob_translate_to_regex (mc_search_cond->str->str, &mc_search_cond->len);
g_string_free (mc_search_cond->str, TRUE);
if (mc_search->is_entire_line) {
g_string_prepend_c (tmp, '^');
g_string_append_c (tmp, '$');
}
mc_search_cond->str = tmp;
mc_search__cond_struct_new_init_regex (charset, mc_search, mc_search_cond);

View File

@ -68,6 +68,9 @@ typedef struct mc_search_struct {
/* search only once. Is this for replace? */
gboolean is_once_only;
/* search entire string (from begin to end). Used only with GLOB search type */
gboolean is_entire_line;
/* function, used for getting data. NULL if not used */
mc_search_fn search_fn;