commit 1a16df92844a7100e9819168318a2bf32aad94a0
parent d89617fb1712b281802d0a8c9d7d978c47363a11
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Fri, 6 Jan 2006 22:04:38 +0000
fix "matchbrackets" breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3260 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
4 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -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)
diff --git a/src/chars.c b/src/chars.c
@@ -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. */
diff --git a/src/proto.h b/src/proto.h
@@ -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
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -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) {