From: Ulrich Drepper Date: Thu, 18 Nov 1999 02:59:57 +0000 (+0000) Subject: Update. X-Git-Tag: upstream/2.30~26566 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35946fb706d6333c5c11663fd0b46c1e9116ae0f;p=external%2Fglibc.git Update. * wcsmbs/wcswidth.c (wcswidth): Don't forget to decrement counter n. --- diff --git a/ChangeLog b/ChangeLog index 5ecb2e1..bf77e12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 1999-11-17 Ulrich Drepper + * wcsmbs/wcswidth.c (wcswidth): Don't forget to decrement counter n. + * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Remove greg_t, gregset_t, fpregset_t, and NGREG definitions. diff --git a/localedata/ChangeLog b/localedata/ChangeLog index f7fcf3e..811d9d1 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,5 +1,8 @@ 1999-11-17 Ulrich Drepper + * charmaps/ISO-8859-1: Don't define values for non-printable + characters. + * charmaps/ISO-8859-1: Add width information. 1999-11-12 Ulrich Drepper diff --git a/localedata/charmaps/ISO-8859-1 b/localedata/charmaps/ISO-8859-1 index 0efd36b..5d28196 100644 --- a/localedata/charmaps/ISO-8859-1 +++ b/localedata/charmaps/ISO-8859-1 @@ -355,8 +355,6 @@ CHARMAP END CHARMAP WIDTH -... 0 ...<'?> 1 -
... 0 ... 1 END WIDTH diff --git a/wcsmbs/wcswidth.c b/wcsmbs/wcswidth.c index 2828b80..78fc427 100644 --- a/wcsmbs/wcswidth.c +++ b/wcsmbs/wcswidth.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -26,7 +26,7 @@ wcswidth (const wchar_t *s, size_t n) { int result = 0; - while (n > 0 && *s != L'\0') + while (n-- > 0 && *s != L'\0') { int now = internal_wcwidth (*s); if (now == -1) diff --git a/wcsmbs/wcwidth.h b/wcsmbs/wcwidth.h index 4c561f9..b8627c5 100644 --- a/wcsmbs/wcwidth.h +++ b/wcsmbs/wcwidth.h @@ -1,5 +1,5 @@ /* Internal header containing implementation of wcwidth() function. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #include "../wctype/cname-lookup.h" /* Array containing width information. */ @@ -33,7 +34,7 @@ internal_wcwidth (wint_t ch) return 0; idx = cname_lookup (ch); - if (idx == ~((size_t) 0)) + if (idx == ~((size_t) 0) || (__ctype32_b[idx] & _ISwprint) == 0) return -1; return (int) __ctype_width[idx];