mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
1030: Fixed issue with undefined HAVE_REGEX_H.
(cherry picked from commit 442b0d83b0
)
This commit is contained in:
parent
46e76e0688
commit
e83f76b79e
@ -1576,14 +1576,17 @@ search_typeahead(struct session *ses, struct document_view *doc_view,
|
|||||||
* a nice cleanup target ;-). --pasky */
|
* a nice cleanup target ;-). --pasky */
|
||||||
|
|
||||||
enum search_option {
|
enum search_option {
|
||||||
|
#ifdef HAVE_REGEX_H
|
||||||
SEARCH_OPT_REGEX,
|
SEARCH_OPT_REGEX,
|
||||||
|
#endif
|
||||||
SEARCH_OPT_CASE,
|
SEARCH_OPT_CASE,
|
||||||
|
|
||||||
SEARCH_OPTIONS,
|
SEARCH_OPTIONS,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct option_resolver resolvers[] = {
|
static struct option_resolver resolvers[] = {
|
||||||
|
#ifdef HAVE_REGEX_H
|
||||||
{ SEARCH_OPT_REGEX, "regex" },
|
{ SEARCH_OPT_REGEX, "regex" },
|
||||||
|
#endif
|
||||||
{ SEARCH_OPT_CASE, "case" },
|
{ SEARCH_OPT_CASE, "case" },
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1648,7 +1651,11 @@ search_dlg_do(struct terminal *term, struct memory_list *ml,
|
|||||||
hop->values, SEARCH_OPTIONS);
|
hop->values, SEARCH_OPTIONS);
|
||||||
hop->data = data;
|
hop->data = data;
|
||||||
|
|
||||||
|
#ifdef HAVE_REGEX_H
|
||||||
#define SEARCH_WIDGETS_COUNT 8
|
#define SEARCH_WIDGETS_COUNT 8
|
||||||
|
#else
|
||||||
|
#define SEARCH_WIDGETS_COUNT 5
|
||||||
|
#endif
|
||||||
dlg = calloc_dialog(SEARCH_WIDGETS_COUNT, MAX_STR_LEN);
|
dlg = calloc_dialog(SEARCH_WIDGETS_COUNT, MAX_STR_LEN);
|
||||||
if (!dlg) {
|
if (!dlg) {
|
||||||
mem_free(hop);
|
mem_free(hop);
|
||||||
@ -1668,9 +1675,11 @@ search_dlg_do(struct terminal *term, struct memory_list *ml,
|
|||||||
field = get_dialog_offset(dlg, SEARCH_WIDGETS_COUNT);
|
field = get_dialog_offset(dlg, SEARCH_WIDGETS_COUNT);
|
||||||
add_dlg_field(dlg, text, 0, 0, NULL, MAX_STR_LEN, field, history);
|
add_dlg_field(dlg, text, 0, 0, NULL, MAX_STR_LEN, field, history);
|
||||||
|
|
||||||
|
#ifdef HAVE_REGEX_H
|
||||||
add_dlg_radio(dlg, _("Normal search", term), 1, 0, &hop->values[SEARCH_OPT_REGEX].number);
|
add_dlg_radio(dlg, _("Normal search", term), 1, 0, &hop->values[SEARCH_OPT_REGEX].number);
|
||||||
add_dlg_radio(dlg, _("Regexp search", term), 1, 1, &hop->values[SEARCH_OPT_REGEX].number);
|
add_dlg_radio(dlg, _("Regexp search", term), 1, 1, &hop->values[SEARCH_OPT_REGEX].number);
|
||||||
add_dlg_radio(dlg, _("Extended regexp search", term), 1, 2, &hop->values[SEARCH_OPT_REGEX].number);
|
add_dlg_radio(dlg, _("Extended regexp search", term), 1, 2, &hop->values[SEARCH_OPT_REGEX].number);
|
||||||
|
#endif
|
||||||
add_dlg_radio(dlg, _("Case sensitive", term), 2, 1, &hop->values[SEARCH_OPT_CASE].number);
|
add_dlg_radio(dlg, _("Case sensitive", term), 2, 1, &hop->values[SEARCH_OPT_CASE].number);
|
||||||
add_dlg_radio(dlg, _("Case insensitive", term), 2, 0, &hop->values[SEARCH_OPT_CASE].number);
|
add_dlg_radio(dlg, _("Case insensitive", term), 2, 0, &hop->values[SEARCH_OPT_CASE].number);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user