From: David Lawrence Ramsey Date: Tue, 8 Nov 2005 02:20:22 +0000 (+0000) Subject: in mbwidth(), if wcwidth() returns -1 for the character passed in, treat X-Git-Tag: v1.3.10~144 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4a8c9b6124fdf76403fd9319bf8270ce3fdf457d;p=nano.git in mbwidth(), if wcwidth() returns -1 for the character passed in, treat the character as being one column wide instead of zero columns wide, since there are display problems that crop up with the latter approach git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3102 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 7ccd9613..563ba332 100644 --- a/ChangeLog +++ b/ChangeLog @@ -73,6 +73,12 @@ CVS code - nanogetstr() (renamed get_prompt_string()), statusq() (renamed do_prompt()), statusq_abort() (renamed do_prompt_abort()), and do_yesno() (renamed do_yesno_prompt()). (DLR) +- chars.c: + mbwidth() + - If wcwidth() returns -1 for the character passed in, treat the + character as being one column wide instead of zero columns + wide, since there are display problems that crop up with the + latter approach. (DLR) - files.c: read_file() - Remove apparently unneeded logic to handle a case where diff --git a/src/chars.c b/src/chars.c index ee1b42c2..c48e3484 100644 --- a/src/chars.c +++ b/src/chars.c @@ -300,7 +300,7 @@ int mbwidth(const char *c) width = wcwidth(wc); if (width == -1) - width++; + width = 1; return width; } else