Eliding a variable.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4660 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2014-03-21 12:47:34 +00:00
parent cc7fef723d
commit 0b2f84322a
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2014-03-21 Benno Schulenberg <bensberg@justemail.net>
* src/chars.c (is_punct_mbchar, mbstrchr) - Elide a variable,
thus making two ifs identical to six others.
2014-03-19 Benno Schulenberg <bensberg@justemail.net>
* doc/nanorc.sample.in - Document the changed whitespace defaults.
* src/global.c, doc/man/nanorc.5 - Allow softwrap to be rebound.

View File

@ -184,9 +184,8 @@ bool is_punct_mbchar(const char *c)
#ifdef ENABLE_UTF8
if (use_utf8) {
wchar_t wc;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
if (c_mb_len < 0) {
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
mbtowc_reset();
wc = bad_wchar;
}
@ -788,9 +787,8 @@ char *mbstrchr(const char *s, const char *c)
char *s_mb = charalloc(MB_CUR_MAX);
const char *q = s;
wchar_t ws, wc;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
if (c_mb_len < 0) {
if (mbtowc(&wc, c, MB_CUR_MAX) < 0) {
mbtowc_reset();
wc = (unsigned char)*c;
bad_c_mb = TRUE;