do_int_spell_fix()
- Move the REVERSE_SEARCH flag toggling into the NANO_SMALL
#ifdef, since the tiny version of nano doesn't support reverse
- searching. Also, turn the USE_REGEXP flag off during spell
- checking in order to avoid a potential segfault. (DLR)
+ searching. Move the CASE_SENSITIVE flag toggling out in order
+ to allow the internal spell checker to work when NANO_SMALL is
+ defined and DISABLE_SPELLER isn't. Also, turn the USE_REGEXP
+ flag off during spell checking in order to avoid a potential
+ segfault. (DLR)
justify_format()
- For more compatibility with Pico, remove extra space after a
character in punct if that character is the same as the one
debugging messages indicating when a flag is set or unset.
(DLR)
- search.c:
+ regexp_init()
+ - If NANO_SMALL is defined, don't bother checking the
+ CASE_SENSITIVE flag or using its value when compiling a list
+ of matching regular expressions. (DLR)
search_init()
- Add parameter use_answer. When it's TRUE, only set
backupstring to answer. This is needed to preserve the text
/* Save where we are. */
bool accepted = TRUE;
/* The return value. */
-#ifndef NANO_SMALL
bool case_sens_set = ISSET(CASE_SENSITIVE);
+#ifndef NANO_SMALL
bool reverse_search_set = ISSET(REVERSE_SEARCH);
bool old_mark_set = ISSET(MARK_ISSET);
#endif
bool regexp_set = ISSET(USE_REGEXP);
#endif
-#ifndef NANO_SMALL
/* Make sure spell-check is case sensitive. */
SET(CASE_SENSITIVE);
+#ifndef NANO_SMALL
/* Make sure spell-check goes forward only. */
UNSET(REVERSE_SEARCH);
current_x = current_x_save;
edittop = edittop_save;
-#ifndef NANO_SMALL
/* Restore case sensitivity setting. */
if (!case_sens_set)
UNSET(CASE_SENSITIVE);
+#ifndef NANO_SMALL
/* Restore search/replace direction. */
if (reverse_search_set)
SET(REVERSE_SEARCH);
* bar. Return value 1 means success. */
int regexp_init(const char *regexp)
{
- int rc = regcomp(&search_regexp, regexp, REG_EXTENDED |
- (ISSET(CASE_SENSITIVE) ? 0 : REG_ICASE));
+ int rc = regcomp(&search_regexp, regexp, REG_EXTENDED
+#ifndef NANO_SMALL
+ | (ISSET(CASE_SENSITIVE) ? 0 : REG_ICASE)
+#endif
+ );
assert(!regexp_compiled);
if (rc != 0) {