From: David Lawrence Ramsey Date: Tue, 15 Nov 2005 19:01:07 +0000 (+0000) Subject: in mbstrchr(), detect the case where the character isn't found in the X-Git-Tag: v1.3.10~67 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bc8b7d74ebc494c5f69b826100d62fd1c4769dc8;p=nano.git in mbstrchr(), detect the case where the character isn't found in the string more accurately git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3179 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 1e4a23b4..323a1a45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -107,6 +107,9 @@ CVS code - character as having the width of Unicode U+FFFD (Replacement Character) instead of having a width of zero, since display problems can crop up with the latter approach. (DLR) + mbstrchr() + - Detect the case where the character isn't found in the string + more accurately. (DLR) - cut.c: cut_line() - Since placewewant will always be zero after the line is cut, diff --git a/src/chars.c b/src/chars.c index 3d57d38b..90808a91 100644 --- a/src/chars.c +++ b/src/chars.c @@ -852,7 +852,7 @@ char *mbstrchr(const char *s, char *c) free(s_mb); - if (ws != wc) + if (*s == '\0') q = NULL; return (char *)q;