"", *nano_lastline_msg = "", *nano_refresh_msg =
"", *nano_mark_msg = "", *nano_delete_msg =
"", *nano_backspace_msg = "", *nano_tab_msg =
- "", *nano_enter_msg = "", *nano_case_msg =
- "", *nano_cancel_msg = "", *nano_unjustify_msg =
- "", *nano_append_msg = "", *nano_reverse_msg =
- "", *nano_regexp_msg = "";
+ "", *nano_enter_msg = "", *nano_cancel_msg =
+ "", *nano_unjustify_msg = "", *nano_append_msg = "";
#ifndef NANO_SMALL
- char *nano_tofiles_msg = "";
- char *nano_gotodir_msg = "";
+ char *nano_tofiles_msg = "", *nano_gotodir_msg = "", *nano_case_msg =
+ "", *nano_reverse_msg = "", *nano_regexp_msg = "";
nano_help_msg = _("Invoke the help menu");
nano_writeout_msg = _("Write the current file to disk");
_("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
do_gotoline_void);
- sc_init_one(&whereis_list[4], NANO_CANCEL_KEY, _("Cancel"),
- nano_cancel_msg, 0, 0, 0, VIEW, 0);
-
- sc_init_one(&whereis_list[5], TOGGLE_CASE_KEY, _("Case Sens"),
+#ifndef NANO_SMALL
+ sc_init_one(&whereis_list[4], TOGGLE_CASE_KEY, _("Case Sens"),
nano_case_msg, 0, 0, 0, VIEW, 0);
- sc_init_one(&whereis_list[6], TOGGLE_BACKWARDS_KEY, _("Backward"),
+ sc_init_one(&whereis_list[5], TOGGLE_BACKWARDS_KEY, _("Backward"),
nano_reverse_msg, 0, 0, 0, VIEW, 0);
#ifdef HAVE_REGEX_H
- sc_init_one(&whereis_list[7], TOGGLE_REGEXP_KEY, _("Regexp"),
- nano_regexp_msg, 0, 0, 0, VIEW, 0);
+ sc_init_one(&whereis_list[REPLACE_LIST_LEN - 2], TOGGLE_REGEXP_KEY,
+ _("Regexp"), nano_regexp_msg, 0, 0, 0, VIEW, 0);
#endif
+#endif /* NANO_SMALL */
+
+ sc_init_one(&whereis_list[REPLACE_LIST_LEN - 1], NANO_CANCEL_KEY,
+ _("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0);
+
sc_init_one(&replace_list[0], NANO_FIRSTLINE_KEY, _("First Line"),
nano_firstline_msg, 0, 0, 0, VIEW, do_first_line);
_("Goto Line"), nano_goto_msg, 0, 0, 0, VIEW,
do_gotoline_void);
- sc_init_one(&replace_list[4], NANO_CANCEL_KEY, _("Cancel"),
- nano_cancel_msg, 0, 0, 0, VIEW, 0);
-
- sc_init_one(&replace_list[5], TOGGLE_CASE_KEY, _("Case Sens"),
+#ifndef NANO_SMALL
+ sc_init_one(&replace_list[4], TOGGLE_CASE_KEY, _("Case Sens"),
nano_case_msg, 0, 0, 0, VIEW, 0);
- sc_init_one(&replace_list[6], TOGGLE_BACKWARDS_KEY, _("Backward"),
+ sc_init_one(&replace_list[5], TOGGLE_BACKWARDS_KEY, _("Backward"),
nano_reverse_msg, 0, 0, 0, VIEW, 0);
#ifdef HAVE_REGEX_H
- sc_init_one(&replace_list[7], TOGGLE_REGEXP_KEY, _("Regexp"),
- nano_regexp_msg, 0, 0, 0, VIEW, 0);
+ sc_init_one(&replace_list[REPLACE_LIST_LEN - 2], TOGGLE_REGEXP_KEY,
+ _("Regexp"), nano_regexp_msg, 0, 0, 0, VIEW, 0);
#endif
+#endif /* NANO_SMALL */
+
+ sc_init_one(&replace_list[REPLACE_LIST_LEN - 1], NANO_CANCEL_KEY,
+ _("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0);
sc_init_one(&replace_list_2[0], NANO_FIRSTLINE_KEY, _("First Line"),
}
}
+/* None of this is needed if we're using NANO_SMALL! */
+#ifndef NANO_SMALL
char *revstrstr(char *haystack, char *needle, char *rev_start)
{
char *p, *q, *r;
}
return 0;
}
+#endif /* NANO_SMALL */
/* This is now mutt's version (called mutt_stristr) because it doesn't
use memory allocation to do a simple search (yuck). */
char *i, *j;
if (ISSET(USE_REGEXP)) {
+#ifndef NANO_SMALL
if (!ISSET(REVERSE_SEARCH)) {
result = regexec(&search_regexp, haystack, 10, regmatches, 0);
if (!result)
return haystack + regmatches[0].rm_so;
} else {
+#endif
/* do quick check first */
if (!(regexec(&search_regexp, haystack, 10, regmatches, 0))) {
/* there is a match */
if (j <= rev_start)
return j;
}
+
}
+#ifndef NANO_SMALL
}
+#endif
return 0;
}
#endif
if (ISSET(CASE_SENSITIVE)) {
- if (!ISSET(REVERSE_SEARCH))
- return strstr(haystack,needle);
- else
+#ifndef NANO_SMALL
+ if (ISSET(REVERSE_SEARCH))
return revstrstr(haystack, needle, rev_start);
+ else
+#endif
+ return strstr(haystack,needle);
+
} else {
- if (!ISSET(REVERSE_SEARCH))
- return strcasestr(haystack, needle);
- else
+#ifndef NANO_SMALL
+ if (ISSET(REVERSE_SEARCH))
return revstrcasestr(haystack, needle, rev_start);
+ else
+#endif
+ return strcasestr(haystack, needle);
}
}