1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

1030: Fixed issue with undefined HAVE_REGEX_H.

This commit is contained in:
Witold Filipczyk 2008-07-12 18:36:24 +02:00 committed by Kalle Olavi Niemitalo
parent 76c89a6961
commit 442b0d83b0

View File

@ -1494,14 +1494,17 @@ search_typeahead(struct session *ses, struct document_view *doc_view,
* a nice cleanup target ;-). --pasky */
enum search_option {
#ifdef HAVE_REGEX_H
SEARCH_OPT_REGEX,
#endif
SEARCH_OPT_CASE,
SEARCH_OPTIONS,
};
static struct option_resolver resolvers[] = {
#ifdef HAVE_REGEX_H
{ SEARCH_OPT_REGEX, "regex" },
#endif
{ SEARCH_OPT_CASE, "case" },
};
@ -1564,7 +1567,11 @@ search_dlg_do(struct terminal *term, struct memory_list *ml,
hop->values, SEARCH_OPTIONS);
hop->data = data;
#ifdef HAVE_REGEX_H
#define SEARCH_WIDGETS_COUNT 8
#else
#define SEARCH_WIDGETS_COUNT 5
#endif
dlg = calloc_dialog(SEARCH_WIDGETS_COUNT, MAX_STR_LEN);
if (!dlg) {
mem_free(hop);
@ -1584,9 +1591,11 @@ search_dlg_do(struct terminal *term, struct memory_list *ml,
field = get_dialog_offset(dlg, SEARCH_WIDGETS_COUNT);
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, _("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);
#endif
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);