tweaks: rename a function, to be simpler and more accurate
Этот коммит содержится в:
родитель
2b21d53857
Коммит
01e6d435fe
@ -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))
|
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_JUSTIFY))
|
||||||
/* Return TRUE if the given string contains at least one blank character,
|
/* Return TRUE if the given string contains at least one blank character,
|
||||||
* and FALSE otherwise. */
|
* and FALSE otherwise. */
|
||||||
bool has_blank_mbchars(const char *s)
|
bool has_blank_char(const char *s)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
if (use_utf8) {
|
if (use_utf8) {
|
||||||
|
@ -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);
|
char *mbrevstrpbrk(const char *head, const char *accept, const char *index);
|
||||||
#endif
|
#endif
|
||||||
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_JUSTIFY))
|
#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
|
#endif
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
bool is_valid_unicode(wchar_t wc);
|
bool is_valid_unicode(wchar_t wc);
|
||||||
|
@ -1129,7 +1129,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
|
|||||||
}
|
}
|
||||||
if (strcasecmp(rcopts[i].name, "matchbrackets") == 0) {
|
if (strcasecmp(rcopts[i].name, "matchbrackets") == 0) {
|
||||||
matchbrackets = option;
|
matchbrackets = option;
|
||||||
if (has_blank_mbchars(matchbrackets)) {
|
if (has_blank_char(matchbrackets)) {
|
||||||
rcfile_error(N_("Non-blank characters required"));
|
rcfile_error(N_("Non-blank characters required"));
|
||||||
free(matchbrackets);
|
free(matchbrackets);
|
||||||
matchbrackets = NULL;
|
matchbrackets = NULL;
|
||||||
@ -1149,13 +1149,13 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
if (strcasecmp(rcopts[i].name, "punct") == 0) {
|
if (strcasecmp(rcopts[i].name, "punct") == 0) {
|
||||||
if (has_blank_mbchars(option)) {
|
if (has_blank_char(option)) {
|
||||||
rcfile_error(N_("Non-blank characters required"));
|
rcfile_error(N_("Non-blank characters required"));
|
||||||
free(option);
|
free(option);
|
||||||
} else
|
} else
|
||||||
punct = option;
|
punct = option;
|
||||||
} else if (strcasecmp(rcopts[i].name, "brackets") == 0) {
|
} 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"));
|
rcfile_error(N_("Non-blank characters required"));
|
||||||
free(option);
|
free(option);
|
||||||
} else
|
} else
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user