From: David Lawrence Ramsey Date: Sat, 9 Oct 2004 16:59:43 +0000 (+0000) Subject: in do_int_spell_fix(), move the REVERSE_SEARCH flag toggling into the X-Git-Tag: v1.3.5~141 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=d93ee682c05c8dafc2391d2ac87d6e6b59f6e399;p=nano.git 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 --- diff --git a/ChangeLog b/ChangeLog index e90a5fd8..090d252f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/src/nano.c b/src/nano.c index b59eb664..0d1c9a4c 100644 --- a/src/nano.c +++ b/src/nano.c @@ -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; - /* Restore search/replace direction. */ - if (reverse_search_set) - SET(REVERSE_SEARCH); - #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); + /* 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; }