fix "matchbrackets" breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3260 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
diff --git a/src/chars.c b/src/chars.c
index 340b682..bfdaaf6 100644
--- a/src/chars.c
+++ b/src/chars.c
@@ -927,7 +927,7 @@
}
#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 @@
#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. */
diff --git a/src/proto.h b/src/proto.h
index f93d56f..a96ea17 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -210,7 +210,7 @@
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
diff --git a/src/rcfile.c b/src/rcfile.c
index 7d56909..120fee9 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -647,7 +647,17 @@
} 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) {