From 356d2482c5af7d6508999e4fd6887ab9f808e618 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 13 Jun 2005 19:51:56 +0000 Subject: [PATCH] nisw?blank() should return int, not bool, to match isblank() git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2654 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/chars.c | 18 +++++++++--------- src/proto.h | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/chars.c b/src/chars.c index 34712dc7..341280c1 100644 --- a/src/chars.c +++ b/src/chars.c @@ -39,16 +39,9 @@ #endif #endif -/* Return TRUE if the value of c is in byte range, and FALSE - * otherwise. */ -bool is_byte(int c) -{ - return ((unsigned int)c == (unsigned char)c); -} - #ifndef HAVE_ISBLANK /* This function is equivalent to isblank(). */ -bool nisblank(int c) +int nisblank(int c) { return isspace(c) && (c == '\t' || !is_cntrl_char(c)); } @@ -56,12 +49,19 @@ bool nisblank(int c) #if defined(NANO_WIDE) && !defined(HAVE_ISWBLANK) /* This function is equivalent to iswblank(). */ -bool niswblank(wint_t wc) +int niswblank(wint_t wc) { return iswspace(wc) && (wc == '\t' || !is_cntrl_wchar(wc)); } #endif +/* Return TRUE if the value of c is in byte range, and FALSE + * otherwise. */ +bool is_byte(int c) +{ + return ((unsigned int)c == (unsigned char)c); +} + /* This function is equivalent to isblank() for multibyte characters. */ bool is_blank_mbchar(const char *c) { diff --git a/src/proto.h b/src/proto.h index a5b4c5fd..a41e647f 100644 --- a/src/proto.h +++ b/src/proto.h @@ -159,13 +159,13 @@ extern char *homedir; /* Functions we want available. */ /* Public functions in chars.c. */ -bool is_byte(int c); #ifndef HAVE_ISBLANK -bool nisblank(int c); +int nisblank(int c); #endif #if defined(NANO_WIDE) && !defined(HAVE_ISWBLANK) -bool niswblank(wint_t wc); +int niswblank(wint_t wc); #endif +bool is_byte(int c); bool is_blank_mbchar(const char *c); bool is_cntrl_char(int c); #ifdef NANO_WIDE -- 2.39.5