From 442b0d83b021217539d5a00409f97ade2f248baa Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sat, 12 Jul 2008 18:36:24 +0200 Subject: [PATCH] 1030: Fixed issue with undefined HAVE_REGEX_H. --- src/viewer/text/search.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/viewer/text/search.c b/src/viewer/text/search.c index 53716882..c5fa9b0d 100644 --- a/src/viewer/text/search.c +++ b/src/viewer/text/search.c @@ -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); -- 2.11.4.GIT