Commit 1a16df92 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

fix "matchbrackets" breakage

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3260 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent d89617fb
Showing with 15 additions and 5 deletions
+15 -5
......@@ -13,7 +13,7 @@ CVS code -
New functions mbstrpbrk() and mbrevstrpbrk(); changes to
find_statusbar_bracket_match(), do_statusbar_find_bracket(),
find_bracket_match(), do_find_bracket(), main(),
nanorc.5, and nanorc.sample. (DLR)
parse_rcfile(), nanorc.5, and nanorc.sample. (DLR)
- chars.c:
mbstrchr()
- Make parameter c const. (DLR)
......
......@@ -927,7 +927,7 @@ char *mbrevstrpbrk(const char *s, const char *accept, const char
}
#endif /* !NANO_TINY */
#if !defined(DISABLE_JUSTIFY) && defined(ENABLE_NANORC)
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY))
/* Return TRUE if the string s contains one or more blank characters,
* and FALSE otherwise. */
bool has_blank_chars(const char *s)
......@@ -973,7 +973,7 @@ bool has_blank_mbchars(const char *s)
#endif
return has_blank_chars(s);
}
#endif /* !DISABLE_JUSTIFY && ENABLE_NANORC */
#endif /* ENABLE_NANORC && (!NANO_TINY || !DISABLE_JUSTIFY) */
#ifdef ENABLE_UTF8
/* Return TRUE if wc is valid Unicode, and FALSE otherwise. */
......
......@@ -210,7 +210,7 @@ char *revstrpbrk(const char *s, const char *accept, const char
char *mbrevstrpbrk(const char *s, const char *accept, const char
*rev_start);
#endif
#if !defined(DISABLE_JUSTIFY) && defined(ENABLE_NANORC)
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY))
bool has_blank_chars(const char *s);
bool has_blank_mbchars(const char *s);
#endif
......
......@@ -647,7 +647,17 @@ void parse_rcfile(FILE *rcstream)
} else
#endif
#ifndef NANO_TINY
if (strcasecmp(rcopts[i].name, "whitespace") == 0) {
if (strcasecmp(rcopts[i].name,
"matchbrackets") == 0) {
matchbrackets = option;
if (has_blank_mbchars(matchbrackets)) {
rcfile_error(
N_("Non-blank characters required"));
free(matchbrackets);
matchbrackets = NULL;
}
} else if (strcasecmp(rcopts[i].name,
"whitespace") == 0) {
whitespace = option;
if (mbstrlen(whitespace) != 2 ||
strlenpt(whitespace) != 2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment