minor fixes involving case insensitive searches and NANO_SMALL

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1984 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2004-10-11 13:55:33 +00:00
parent 731e7f28e7
commit 49d5c1bf1c
3 changed files with 17 additions and 7 deletions

View File

@ -120,8 +120,11 @@ CVS code -
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
@ -146,6 +149,10 @@ CVS code -
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

View File

@ -1425,8 +1425,8 @@ bool do_int_spell_fix(const char *word)
/* 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
@ -1434,10 +1434,10 @@ bool do_int_spell_fix(const char *word)
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);
@ -1500,11 +1500,11 @@ 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);
#ifndef NANO_SMALL
/* Restore search/replace direction. */
if (reverse_search_set)
SET(REVERSE_SEARCH);

View File

@ -42,8 +42,11 @@ static int regexp_compiled = FALSE;
* 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) {