From 68f67fcb80b65a8e2acca4d4db41a38acd2d23d8 Mon Sep 17 00:00:00 2001
From: Vit Rosin <vit_r@list.ru>
Date: Thu, 18 Feb 2010 13:53:32 +0000
Subject: [PATCH] 'const char *error;' to 'char *error;' redeclaration
because first *error blocks all the rest errors
---
lib/search/regex.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/lib/search/regex.c b/lib/search/regex.c
index 0fb3866..8bc45e8 100644
a
|
b
|
mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_ |
481 | 481 | #ifdef SEARCH_TYPE_GLIB |
482 | 482 | GError *error = NULL; |
483 | 483 | #else /* SEARCH_TYPE_GLIB */ |
484 | | const char *error; |
485 | | int erroffset; |
| 484 | char *error = NULL; |
| 485 | int erroffset; |
486 | 486 | #endif /* SEARCH_TYPE_GLIB */ |
487 | 487 | |
488 | 488 | if (!lc_mc_search->is_case_sentitive) { |
… |
… |
mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_ |
492 | 492 | g_string_free (tmp, TRUE); |
493 | 493 | } |
494 | 494 | #ifdef SEARCH_TYPE_GLIB |
495 | | mc_search_cond->regex_handle = |
496 | | g_regex_new (mc_search_cond->str->str, G_REGEX_OPTIMIZE | G_REGEX_RAW | G_REGEX_DOTALL, 0, |
497 | | &error); |
| 495 | mc_search_cond->regex_handle = (mc_search_regex_t *) |
| 496 | g_regex_new (mc_search_cond->str->str, |
| 497 | G_REGEX_OPTIMIZE | G_REGEX_RAW | G_REGEX_DOTALL, |
| 498 | 0, &error); |
498 | 499 | |
499 | 500 | if (error != NULL) { |
500 | 501 | lc_mc_search->error = MC_SEARCH_E_REGEX_COMPILE; |
… |
… |
mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_ |
503 | 504 | return; |
504 | 505 | } |
505 | 506 | #else /* SEARCH_TYPE_GLIB */ |
506 | | mc_search_cond->regex_handle = |
| 507 | mc_search_cond->regex_handle = (mc_search_regex_t *) |
507 | 508 | pcre_compile (mc_search_cond->str->str, PCRE_EXTRA, &error, &erroffset, NULL); |
508 | 509 | if (mc_search_cond->regex_handle == NULL) { |
509 | 510 | lc_mc_search->error = MC_SEARCH_E_REGEX_COMPILE; |
510 | 511 | lc_mc_search->error_str = g_strdup (error); |
| 512 | g_free (error); |
511 | 513 | return; |
512 | 514 | } |
513 | 515 | lc_mc_search->regex_match_info = pcre_study (mc_search_cond->regex_handle, 0, &error); |
514 | 516 | if (lc_mc_search->regex_match_info == NULL) { |
515 | | if (error) { |
| 517 | if (error != NULL) { |
516 | 518 | lc_mc_search->error = MC_SEARCH_E_REGEX_COMPILE; |
517 | 519 | lc_mc_search->error_str = g_strdup (error); |
| 520 | g_free (error); |
518 | 521 | g_free (mc_search_cond->regex_handle); |
519 | 522 | mc_search_cond->regex_handle = NULL; |
520 | 523 | return; |