tweaks: rename a function, to be simpler and more accurate

master
Benno Schulenberg 2019-03-21 17:42:34 +01:00
parent 2b21d53857
commit 01e6d435fe
3 changed files with 5 additions and 5 deletions

View File

@ -638,7 +638,7 @@ char *mbrevstrpbrk(const char *head, const char *accept, const char *pointer)
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_JUSTIFY))
/* Return TRUE if the given string contains at least one blank character,
* and FALSE otherwise. */
bool has_blank_mbchars(const char *s)
bool has_blank_char(const char *s)
{
#ifdef ENABLE_UTF8
if (use_utf8) {

View File

@ -228,7 +228,7 @@ char *revstrpbrk(const char *head, const char *accept, const char *index);
char *mbrevstrpbrk(const char *head, const char *accept, const char *index);
#endif
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_JUSTIFY))
bool has_blank_mbchars(const char *s);
bool has_blank_char(const char *s);
#endif
#ifdef ENABLE_UTF8
bool is_valid_unicode(wchar_t wc);

View File

@ -1129,7 +1129,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
}
if (strcasecmp(rcopts[i].name, "matchbrackets") == 0) {
matchbrackets = option;
if (has_blank_mbchars(matchbrackets)) {
if (has_blank_char(matchbrackets)) {
rcfile_error(N_("Non-blank characters required"));
free(matchbrackets);
matchbrackets = NULL;
@ -1149,13 +1149,13 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
#endif
#ifdef ENABLE_JUSTIFY
if (strcasecmp(rcopts[i].name, "punct") == 0) {
if (has_blank_mbchars(option)) {
if (has_blank_char(option)) {
rcfile_error(N_("Non-blank characters required"));
free(option);
} else
punct = option;
} else if (strcasecmp(rcopts[i].name, "brackets") == 0) {
if (has_blank_mbchars(option)) {
if (has_blank_char(option)) {
rcfile_error(N_("Non-blank characters required"));
free(option);
} else