in 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


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1979 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2004-10-09 16:59:43 +00:00
parent 3497666a21
commit d93ee682c0
2 changed files with 30 additions and 7 deletions

View File

@ -115,6 +115,11 @@ CVS code -
miscellaneous meta key sequence to be displayed in a shortcut
that has a control key, a primary meta key sequence, and a
miscellaneous meta key sequence, but no function key. (DLR)
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)
justify_format()
- For more compatibility with Pico, remove extra space after a
character in punct if that character is the same as the one

View File

@ -1425,17 +1425,29 @@ bool do_int_spell_fix(const char *word)
/* Save where we are. */
bool accepted = TRUE;
/* The return value. */
bool reverse_search_set = ISSET(REVERSE_SEARCH);
#ifndef NANO_SMALL
bool case_sens_set = ISSET(CASE_SENSITIVE);
bool reverse_search_set = ISSET(REVERSE_SEARCH);
bool old_mark_set = ISSET(MARK_ISSET);
#endif
#ifndef HAVE_REGEX_H
bool regexp_set = ISSET(USE_REGEXP);
#endif
#ifndef NANO_SMALL
/* Make sure spell-check is case sensitive. */
SET(CASE_SENSITIVE);
/* Make sure spell-check goes forward only. */
UNSET(REVERSE_SEARCH);
/* Make sure the marking highlight is off during spell-check. */
UNSET(MARK_ISSET);
#endif
/* Make sure spell-check goes forward only. */
UNSET(REVERSE_SEARCH);
#ifndef HAVE_REGEX_H
/* Make sure spell-check doesn't use regular expressions. */
UNSET(USE_REGEXP);
#endif
/* Save the current search/replace strings. */
search_init_globals();
@ -1488,18 +1500,24 @@ bool do_int_spell_fix(const char *word)
current_x = current_x_save;
edittop = edittop_save;
#ifndef NANO_SMALL
/* Restore case sensitivity setting. */
if (!case_sens_set)
UNSET(CASE_SENSITIVE);
/* Restore search/replace direction. */
if (reverse_search_set)
SET(REVERSE_SEARCH);
#ifndef NANO_SMALL
if (!case_sens_set)
UNSET(CASE_SENSITIVE);
/* Restore marking highlight. */
if (old_mark_set)
SET(MARK_ISSET);
#endif
#ifndef HAVE_REGEX_H
/* Restore regular expression usage setting. */
if (regexp_set)
SET(USE_REGEXP);
#endif
return accepted;
}