Fix wildcard pattern in file select and file find dialogs
Этот коммит содержится в:
родитель
09bc5434f6
Коммит
c8dd6dbbfd
@ -7,7 +7,7 @@ SUBDIRS = intl po m4 vfs edit src lib doc syntax
|
||||
EXTRA_DIST = FAQ HACKING INSTALL.FAST MAINTAINERS README.QNX TODO pkginfo.in prototype.in mc.qpg mc.spec
|
||||
|
||||
noinst_DATA = mc.spec mc.qpg pkginfo prototype
|
||||
dist_noinst_SCRIPTS = build-glib1.sh build-glib2.sh
|
||||
dist_noinst_SCRIPTS = build-glib2.sh
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
|
@ -487,7 +487,7 @@ void reverse_selection_cmd (void)
|
||||
static void
|
||||
select_unselect_cmd (const char *title, const char *history_name, int cmd)
|
||||
{
|
||||
char *reg_exp, *reg_exp_t;
|
||||
char *reg_exp, *reg_exp_t, *srch_regexp;
|
||||
int i;
|
||||
int c;
|
||||
int dirflag = 0;
|
||||
@ -511,6 +511,7 @@ select_unselect_cmd (const char *title, const char *history_name, int cmd)
|
||||
dirflag = 1;
|
||||
reg_exp_t[strlen (reg_exp_t) - 1] = 0;
|
||||
}
|
||||
srch_regexp = g_strdup_printf("{%s}",reg_exp_t);
|
||||
|
||||
for (i = 0; i < current_panel->count; i++) {
|
||||
if (!strcmp (current_panel->dir.list[i].fname, ".."))
|
||||
@ -522,13 +523,15 @@ select_unselect_cmd (const char *title, const char *history_name, int cmd)
|
||||
if (dirflag)
|
||||
continue;
|
||||
}
|
||||
if (!mc_search(reg_exp_t, current_panel->dir.list[i].fname, MC_SEARCH_T_GLOB))
|
||||
return;
|
||||
if (!mc_search(srch_regexp, current_panel->dir.list[i].fname, MC_SEARCH_T_GLOB)){
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c) {
|
||||
do_file_mark (current_panel, i, cmd);
|
||||
}
|
||||
}
|
||||
g_free(srch_regexp);
|
||||
g_free (reg_exp);
|
||||
}
|
||||
|
||||
|
@ -932,7 +932,7 @@ file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text,
|
||||
}
|
||||
|
||||
if (source_easy_patterns){
|
||||
source_mask = g_strdup_printf("(%s)",orig_mask);
|
||||
source_mask = g_strdup_printf("{%s}",orig_mask);
|
||||
ctx->search_handle = mc_search_new(source_mask,-1);
|
||||
g_free(source_mask);
|
||||
}
|
||||
|
@ -67,11 +67,33 @@ mc_search__glob_translate_to_regex (gchar * str, gsize * len)
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case ',':
|
||||
if (!mc_search__regex_is_char_escaped (str, &(str[loop]) - 1)) {
|
||||
g_string_append (buff, "|");
|
||||
loop++;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '{':
|
||||
if (!mc_search__regex_is_char_escaped (str, &(str[loop]) - 1)) {
|
||||
g_string_append (buff, "(");
|
||||
loop++;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '}':
|
||||
if (!mc_search__regex_is_char_escaped (str, &(str[loop]) - 1)) {
|
||||
g_string_append (buff, ")");
|
||||
loop++;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '\\':
|
||||
case '+':
|
||||
case '.':
|
||||
case '|':
|
||||
case '$':
|
||||
case '(':
|
||||
case ')':
|
||||
case '^':
|
||||
case '-':
|
||||
g_string_append_c (buff, '\\');
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user