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 <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2009-08-24 14:00:14 +03:00
parent b819359535
commit 7dd9fdd505
1 changed files with 2 additions and 3 deletions

View File

@ -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 */ /* FIXME: Need to cleanup this, this ought to be passed non-globaly */
find_pattern = str_unconst (pattern); find_pattern = str_unconst (pattern);
content_pattern = (content != NULL && str_is_valid_string (content)) content_pattern = (content != NULL && str_is_valid_string (content))
? str_create_search_needle (content, content_case_sens_flag) ? g_strdup(content)
: NULL; : NULL;
init_find_vars (); init_find_vars ();
@ -1239,8 +1239,7 @@ find_file (const char *start_dir, const char *pattern, const char *content,
} }
} }
if (content_pattern != NULL) g_free (content_pattern);
str_release_search_needle (content_pattern, content_case_sens_flag);
kill_gui (); kill_gui ();
do_search (NULL); /* force do_search to release resources */ do_search (NULL); /* force do_search to release resources */
g_free (old_dir); g_free (old_dir);