1
1
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
Andrew Borodin 2010-03-31 11:48:53 +04:00
родитель 4cea5be1ac
Коммит e70db42deb
13 изменённых файлов: 31 добавлений и 32 удалений

Просмотреть файл

@ -115,7 +115,7 @@ mc_fhl_parse_get_regexp (mc_fhl_t * fhl, const gchar * group_name)
mc_filter = g_new0 (mc_fhl_filter_t, 1);
mc_filter->type = MC_FLHGH_T_FREGEXP;
mc_filter->search_condition = mc_search_new (regexp, -1);
mc_filter->search_condition->is_case_sentitive = TRUE;
mc_filter->search_condition->is_case_sensitive = TRUE;
mc_filter->search_condition->search_type = MC_SEARCH_T_REGEX;
mc_fhl_parse_fill_color_info (mc_filter, fhl, group_name);
@ -165,7 +165,7 @@ mc_fhl_parse_get_extensions (mc_fhl_t * fhl, const gchar * group_name)
mc_filter = g_new0 (mc_fhl_filter_t, 1);
mc_filter->type = MC_FLHGH_T_FREGEXP;
mc_filter->search_condition = mc_search_new (buf->str, -1);
mc_filter->search_condition->is_case_sentitive =
mc_filter->search_condition->is_case_sensitive =
mc_config_get_bool (fhl->config, group_name, "extensions_case", TRUE);
mc_filter->search_condition->search_type = MC_SEARCH_T_REGEX;

Просмотреть файл

@ -58,8 +58,8 @@ typedef struct mc_search_struct {
/* search in all charsets */
gboolean is_all_charsets;
/* case sentitive search */
gboolean is_case_sentitive;
/* case sensitive search */
gboolean is_case_sensitive;
/* search only once. Is this for replace? */
gboolean is_once_only;
@ -87,7 +87,7 @@ typedef struct mc_search_struct {
off_t start_buffer;
/* some data for regexp */
int num_rezults;
int num_results;
mc_search_matchinfo_t *regex_match_info;
GString *regex_buffer;
#ifdef SEARCH_TYPE_PCRE
@ -140,7 +140,7 @@ gchar **mc_search_get_types_strings_array (size_t *num);
gboolean mc_search (const gchar *, const gchar *, mc_search_type_t);
int mc_search_getstart_rezult_by_num (mc_search_t *, int);
int mc_search_getend_rezult_by_num (mc_search_t *, int);
int mc_search_getstart_result_by_num (mc_search_t *, int);
int mc_search_getend_result_by_num (mc_search_t *, int);
#endif

Просмотреть файл

@ -271,12 +271,12 @@ mc_search__regex_found_cond_one (mc_search_t * lc_mc_search, mc_search_regex_t *
}
return COND__NOT_FOUND;
}
lc_mc_search->num_rezults = g_match_info_get_match_count (lc_mc_search->regex_match_info);
lc_mc_search->num_results = g_match_info_get_match_count (lc_mc_search->regex_match_info);
#else /* SEARCH_TYPE_GLIB */
lc_mc_search->num_rezults = pcre_exec (regex, lc_mc_search->regex_match_info,
lc_mc_search->num_results = pcre_exec (regex, lc_mc_search->regex_match_info,
search_str->str, search_str->len - 1, 0, 0,
lc_mc_search->iovector, MC_SEARCH__NUM_REPLACE_ARGS);
if (lc_mc_search->num_rezults < 0)
if (lc_mc_search->num_results < 0)
{
return COND__NOT_FOUND;
}
@ -530,7 +530,7 @@ mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_
int erroffset;
#endif /* SEARCH_TYPE_GLIB */
if (!lc_mc_search->is_case_sentitive)
if (!lc_mc_search->is_case_sensitive)
{
tmp = g_string_new_len (mc_search_cond->str->str, mc_search_cond->str->len);
g_string_free (mc_search_cond->str, TRUE);
@ -675,10 +675,10 @@ mc_search_regex_prepare_replace_str (mc_search_t * lc_mc_search, GString * repla
num_replace_tokens =
mc_search_regex__get_max_num_of_replace_tokens (replace_str->str, replace_str->len);
if (lc_mc_search->num_rezults < 0)
if (lc_mc_search->num_results < 0)
return g_string_new_len (replace_str->str, replace_str->len);
if (num_replace_tokens > lc_mc_search->num_rezults - 1
if (num_replace_tokens > lc_mc_search->num_results - 1
|| num_replace_tokens > MC_SEARCH__NUM_REPLACE_ARGS)
{
lc_mc_search->error = MC_SEARCH_E_REGEX_REPLACE;
@ -718,7 +718,7 @@ mc_search_regex_prepare_replace_str (mc_search_t * lc_mc_search, GString * repla
continue;
}
if (lc_index > lc_mc_search->num_rezults)
if (lc_index > lc_mc_search->num_results)
{
g_string_free (ret, TRUE);
lc_mc_search->error = MC_SEARCH_E_REGEX_REPLACE;

Просмотреть файл

@ -376,7 +376,7 @@ mc_search (const gchar * pattern, const gchar * str, mc_search_type_t type)
if (search == NULL)
return FALSE;
search->search_type = type;
search->is_case_sentitive = TRUE;
search->is_case_sensitive = TRUE;
if (type == MC_SEARCH_T_GLOB)
search->is_entire_line = TRUE;
@ -389,7 +389,7 @@ mc_search (const gchar * pattern, const gchar * str, mc_search_type_t type)
/* --------------------------------------------------------------------------------------------- */
int
mc_search_getstart_rezult_by_num (mc_search_t * lc_mc_search, int lc_index)
mc_search_getstart_result_by_num (mc_search_t * lc_mc_search, int lc_index)
{
if (!lc_mc_search)
return 0;
@ -411,7 +411,7 @@ mc_search_getstart_rezult_by_num (mc_search_t * lc_mc_search, int lc_index)
/* --------------------------------------------------------------------------------------------- */
int
mc_search_getend_rezult_by_num (mc_search_t * lc_mc_search, int lc_index)
mc_search_getend_result_by_num (mc_search_t * lc_mc_search, int lc_index)
{
if (!lc_mc_search)
return 0;

Просмотреть файл

@ -20,8 +20,7 @@
# 2004: Whitespace(s) & single quote(s) in filename workaround
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=64007
# Slava Zanko <slavazanko@gmail.com>
# 2009: Totally rewrited.
# ALTLinux users have strange artefacts with single quote(s)
# 2009: Totally rewritten.
#
# This file is part of the Midnight Commander.
#

Просмотреть файл

@ -592,7 +592,7 @@ select_unselect_cmd (const char *title, const char *history_name, gboolean do_se
search = mc_search_new (reg_exp, -1);
search->search_type = (shell_patterns != 0) ? MC_SEARCH_T_GLOB : MC_SEARCH_T_REGEX;
search->is_entire_line = TRUE;
search->is_case_sentitive = case_sens != 0;
search->is_case_sensitive = case_sens != 0;
for (i = 0; i < current_panel->count; i++)
{

Просмотреть файл

@ -280,7 +280,7 @@ dview_search_cmd (WDiff * dview)
dview->search.handle->search_type = mcdiffview_search_options.type;
dview->search.handle->is_all_charsets = mcdiffview_search_options.all_codepages;
dview->search.handle->is_case_sentitive = mcdiffview_search_options.case_sens;
dview->search.handle->is_case_sensitive = mcdiffview_search_options.case_sens;
dview->search.handle->whole_words = mcdiffview_search_options.whole_words;
mcdiffview_do_search (dview);

Просмотреть файл

@ -1747,7 +1747,7 @@ edit_replace_cmd (WEdit * edit, int again)
}
edit->search->search_type = edit_search_options.type;
edit->search->is_all_charsets = edit_search_options.all_codepages;
edit->search->is_case_sentitive = edit_search_options.case_sens;
edit->search->is_case_sensitive = edit_search_options.case_sens;
edit->search->whole_words = edit_search_options.whole_words;
edit->search->search_fn = edit_search_cmd_callback;
}
@ -1988,7 +1988,7 @@ edit_search_cmd (WEdit * edit, int again)
edit->search->search_type = edit_search_options.type;
edit->search->is_all_charsets = edit_search_options.all_codepages;
edit->search->is_case_sentitive = edit_search_options.case_sens;
edit->search->is_case_sensitive = edit_search_options.case_sens;
edit->search->whole_words = edit_search_options.whole_words;
edit->search->search_fn = edit_search_cmd_callback;
}
@ -2734,7 +2734,7 @@ edit_collect_completions (WEdit * edit, long start, gsize word_len,
}
srch->search_type = MC_SEARCH_T_REGEX;
srch->is_case_sentitive = TRUE;
srch->is_case_sensitive = TRUE;
srch->search_fn = edit_search_cmd_callback;
/* collect max MAX_WORD_COMPLETIONS completions */

Просмотреть файл

@ -1112,7 +1112,7 @@ file_mask_dialog (FileOpContext * ctx, FileOperation operation,
g_free (def_text_secure);
g_free (source_mask);
ctx->search_handle->is_case_sentitive = TRUE;
ctx->search_handle->is_case_sensitive = TRUE;
if (source_easy_patterns)
ctx->search_handle->search_type = MC_SEARCH_T_GLOB;
else

Просмотреть файл

@ -882,13 +882,13 @@ do_search (struct Dlg_head *h)
{
search_content_handle->search_type =
options.content_regexp ? MC_SEARCH_T_REGEX : MC_SEARCH_T_NORMAL;
search_content_handle->is_case_sentitive = options.content_case_sens;
search_content_handle->is_case_sensitive = options.content_case_sens;
search_content_handle->whole_words = options.content_whole_words;
search_content_handle->is_all_charsets = options.content_all_charsets;
}
search_file_handle = mc_search_new (find_pattern, -1);
search_file_handle->search_type = options.file_pattern ? MC_SEARCH_T_GLOB : MC_SEARCH_T_REGEX;
search_file_handle->is_case_sentitive = options.file_case_sens;
search_file_handle->is_case_sensitive = options.file_case_sens;
search_file_handle->is_all_charsets = options.file_all_charsets;
search_file_handle->is_entire_line = options.file_pattern;

Просмотреть файл

@ -2421,13 +2421,13 @@ do_search (WPanel * panel, int c_code)
switch (quick_search_case_sensitive)
{
case QSEARCH_CASE_SENSITIVE:
search->is_case_sentitive = TRUE;
search->is_case_sensitive = TRUE;
break;
case QSEARCH_CASE_INSENSITIVE:
search->is_case_sentitive = FALSE;
search->is_case_sensitive = FALSE;
break;
default:
search->is_case_sentitive = panel->case_sensitive;
search->is_case_sensitive = panel->case_sensitive;
break;
}
sel = panel->selected;

Просмотреть файл

@ -122,7 +122,7 @@ mcview_continue_search_cmd (mcview_t * view)
{
view->search->search_type = mcview_search_options.type;
view->search->is_all_charsets = mcview_search_options.all_codepages;
view->search->is_case_sentitive = mcview_search_options.case_sens;
view->search->is_case_sensitive = mcview_search_options.case_sens;
view->search->whole_words = mcview_search_options.whole_words;
view->search->search_fn = mcview_search_cmd_callback;
view->search->update_fn = mcview_search_update_cmd_callback;

Просмотреть файл

@ -147,7 +147,7 @@ mcview_dialog_search (mcview_t * view)
{
view->search->search_type = mcview_search_options.type;
view->search->is_all_charsets = mcview_search_options.all_codepages;
view->search->is_case_sentitive = mcview_search_options.case_sens;
view->search->is_case_sensitive = mcview_search_options.case_sens;
view->search->whole_words = mcview_search_options.whole_words;
view->search->search_fn = mcview_search_cmd_callback;
view->search->update_fn = mcview_search_update_cmd_callback;