]> git.wh0rd.org Git - nano.git/commitdiff
correction: in mbwidth(), use the width of Unicode U+FFFD (Replacement
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 8 Nov 2005 02:24:17 +0000 (02:24 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 8 Nov 2005 02:24:17 +0000 (02:24 +0000)
Character) instead of hardcoding a width of one for unprintable
characters

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3103 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/chars.c

index 563ba33269e83f3f970285329536343b70f5dfc0..8138155c7b43f444c1ab6f686192ed4a54a7c193 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,9 +76,9 @@ CVS code -
 - 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)
+         character as having the width of Unicode U+FFFD (Replacement
+         Character) instead of having zero width, 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
index c48e3484bd8117fba2842a4d373c513e0560adec..531ffad0ee5bb4affeb2e37f44040bf835e43b35 100644 (file)
@@ -300,7 +300,7 @@ int mbwidth(const char *c)
        width = wcwidth(wc);
 
        if (width == -1)
-           width = 1;
+           width = wcwidth(bad_wchar);
 
        return width;
     } else