From 660a2e065adbbb057c47b34712598a6f29d87305 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sat, 21 May 2016 14:24:13 +0000
Subject: [PATCH] Save user abort request at generic search function
Save user abort request as MC_SEARCH_CB_ABORT error status.
It is a bit fuzzy here because of ret = MC_SEARCH_CB_ABORT initial default.
Signed-off-by: Andreas Mohr <and@gmx.li>
---
lib/search/regex.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/search/regex.c b/lib/search/regex.c
index a172640..53e2729 100644
a
|
b
|
mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, |
901 | 901 | ret = lc_mc_search->search_fn (user_data, current_pos, ¤t_chr); |
902 | 902 | |
903 | 903 | if (ret == MC_SEARCH_CB_ABORT) |
| 904 | { |
| 905 | lc_mc_search->error = MC_SEARCH_E_ABORT; |
904 | 906 | break; |
| 907 | } |
905 | 908 | |
906 | 909 | if (ret == MC_SEARCH_CB_INVALID) |
907 | 910 | continue; |
… |
… |
mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, |
967 | 970 | |
968 | 971 | if ((lc_mc_search->update_fn != NULL) && |
969 | 972 | ((lc_mc_search->update_fn) (user_data, current_pos) == MC_SEARCH_CB_ABORT)) |
| 973 | { |
| 974 | lc_mc_search->error = MC_SEARCH_E_ABORT; |
970 | 975 | ret = MC_SEARCH_CB_ABORT; |
| 976 | } |
971 | 977 | |
972 | 978 | if (ret == MC_SEARCH_CB_ABORT) |
973 | 979 | break; |
… |
… |
mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, |
975 | 981 | |
976 | 982 | g_string_free (lc_mc_search->regex_buffer, TRUE); |
977 | 983 | lc_mc_search->regex_buffer = NULL; |
978 | | lc_mc_search->error = MC_SEARCH_E_NOTFOUND; |
| 984 | if (lc_mc_search->error != MC_SEARCH_E_ABORT) |
| 985 | lc_mc_search->error = MC_SEARCH_E_NOTFOUND; |
979 | 986 | |
980 | 987 | if (ret != MC_SEARCH_CB_ABORT) |
981 | 988 | lc_mc_search->error_str = g_strdup (_(STR_E_NOTFOUND)); |