- Try to automatically detect whether UTF-8 support is needed by
setting the NO_UTF8 flag if setlocale() returns a string that
doesn't contain "UTF-8". (DLR)
+- utils.c:
+ regexec_safe()
+ - Remove redundant regexec #define, and move the regexec #undef
+ to nano.h. (DLR)
+ is_blank_char()
+ - Rewrite to use ctype functions instead of checking directly
+ for spaces and tabs. (DLR)
- winio.c:
titlebar()
- Rename some variables for consistency, make space an int
#define charcpy(dest, src, n) memcpy(dest, src, (n) * sizeof(char))
#ifdef BROKEN_REGEXEC
+#undef regexec
#define regexec(preg, string, nmatch, pmatch, eflags) regexec_safe(preg, string, nmatch, pmatch, eflags)
#endif
#ifdef HAVE_REGEX_H
#ifdef BROKEN_REGEXEC
-#undef regexec
int regexec_safe(const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags)
{
return regexec(preg, string, nmatch, pmatch, eflags);
return REG_NOMATCH;
}
-#define regexec(preg, string, nmatch, pmatch, eflags) regexec_safe(preg, string, nmatch, pmatch, eflags)
-#endif /* BROKEN_REGEXEC */
+#endif
int regexp_bol_or_eol(const regex_t *preg, const char *string)
{
/* This function is equivalent to isblank(). */
int is_blank_char(int c)
{
- return (c == '\t' || c == ' ');
+ return isspace(c) && (!is_cntrl_char(c) || c == '\t');
}
#endif