From 7dd9fdd505f63bc1e6dd6cafbd69b8b52bc20747 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Mon, 24 Aug 2009 14:00:14 +0300 Subject: [PATCH] Ticket #1543: Case-insensitive regex search with [^ranges] does not work correctly Fixed Case-isentetive search with [ranges]. Reason of bug: content_pattern was initialized via str_create_search_needle() function (from src/strutils.c) This function convert string to lowercase if case_sentitive is off. Therefore string 'some_string[^a-zA-Z]' was transform into 'some_string[^a-za-z]' Fix issue: replace call of str_create_search_needle() function to g_strdup() Signed-off-by: Slava Zanko --- src/find.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/find.c b/src/find.c index 306d70376..849deface 100644 --- a/src/find.c +++ b/src/find.c @@ -1153,7 +1153,7 @@ find_file (const char *start_dir, const char *pattern, const char *content, /* FIXME: Need to cleanup this, this ought to be passed non-globaly */ find_pattern = str_unconst (pattern); content_pattern = (content != NULL && str_is_valid_string (content)) - ? str_create_search_needle (content, content_case_sens_flag) + ? g_strdup(content) : NULL; init_find_vars (); @@ -1239,8 +1239,7 @@ find_file (const char *start_dir, const char *pattern, const char *content, } } - if (content_pattern != NULL) - str_release_search_needle (content_pattern, content_case_sens_flag); + g_free (content_pattern); kill_gui (); do_search (NULL); /* force do_search to release resources */ g_free (old_dir); -- 2.11.4.GIT