diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-08 17:28:33 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-08 17:28:33 +0100 |
| commit | 5f59a34ab747dde8ede7357f3431bf06bd6002fe (patch) | |
| tree | 056a4477fd870d454d5be5868cddab829a47f4d2 /lib/uniwidth | |
| parent | 27dae84ed92f1ef0300263091972338d12e78348 (diff) | |
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'lib/uniwidth')
| -rw-r--r-- | lib/uniwidth/cjk.h | 4 | ||||
| -rw-r--r-- | lib/uniwidth/u16-strwidth.c | 2 | ||||
| -rw-r--r-- | lib/uniwidth/u16-width.c | 6 | ||||
| -rw-r--r-- | lib/uniwidth/u32-strwidth.c | 2 | ||||
| -rw-r--r-- | lib/uniwidth/u32-width.c | 5 | ||||
| -rw-r--r-- | lib/uniwidth/u8-strwidth.c | 2 | ||||
| -rw-r--r-- | lib/uniwidth/u8-width.c | 6 | ||||
| -rw-r--r-- | lib/uniwidth/width.c | 2 |
8 files changed, 12 insertions, 17 deletions
diff --git a/lib/uniwidth/cjk.h b/lib/uniwidth/cjk.h index af41f637..9fc0dbde 100644 --- a/lib/uniwidth/cjk.h +++ b/lib/uniwidth/cjk.h @@ -1,5 +1,5 @@ /* Test for CJK encoding. - Copyright (C) 2001-2002, 2005-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2005-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This file is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#include "streq.h" +#include "streq-opt.h" static int is_cjk_encoding (const char *encoding) diff --git a/lib/uniwidth/u16-strwidth.c b/lib/uniwidth/u16-strwidth.c index 815d1044..d274c9ff 100644 --- a/lib/uniwidth/u16-strwidth.c +++ b/lib/uniwidth/u16-strwidth.c @@ -1,5 +1,5 @@ /* Determine display width of UTF-16 string. - Copyright (C) 2001-2002, 2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This file is free software. diff --git a/lib/uniwidth/u16-width.c b/lib/uniwidth/u16-width.c index 32d47edb..d6d9bfcd 100644 --- a/lib/uniwidth/u16-width.c +++ b/lib/uniwidth/u16-width.c @@ -1,5 +1,5 @@ /* Determine display width of UTF-16 string. - Copyright (C) 2001-2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This file is free software. @@ -39,14 +39,12 @@ u16_width (const uint16_t *s, size_t n, const char *encoding) while (s < s_end) { ucs4_t uc; - int w; - s += u16_mbtouc_unsafe (&uc, s, s_end - s); if (uc == 0) break; /* end of string reached */ - w = uc_width (uc, encoding); + int w = uc_width (uc, encoding); if (w >= 0) /* ignore control characters in the string */ width += w; } diff --git a/lib/uniwidth/u32-strwidth.c b/lib/uniwidth/u32-strwidth.c index e7d894d8..66bc17f6 100644 --- a/lib/uniwidth/u32-strwidth.c +++ b/lib/uniwidth/u32-strwidth.c @@ -1,5 +1,5 @@ /* Determine display width of UTF-32 string. - Copyright (C) 2001-2002, 2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This file is free software. diff --git a/lib/uniwidth/u32-width.c b/lib/uniwidth/u32-width.c index bb4c04a8..42e343d4 100644 --- a/lib/uniwidth/u32-width.c +++ b/lib/uniwidth/u32-width.c @@ -1,5 +1,5 @@ /* Determine display width of UTF-32 string. - Copyright (C) 2001-2002, 2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This file is free software. @@ -37,12 +37,11 @@ u32_width (const uint32_t *s, size_t n, const char *encoding) while (s < s_end) { ucs4_t uc = *s++; - int w; if (uc == 0) break; /* end of string reached */ - w = uc_width (uc, encoding); + int w = uc_width (uc, encoding); if (w >= 0) /* ignore control characters in the string */ width += w; } diff --git a/lib/uniwidth/u8-strwidth.c b/lib/uniwidth/u8-strwidth.c index 794d60a0..1efd104f 100644 --- a/lib/uniwidth/u8-strwidth.c +++ b/lib/uniwidth/u8-strwidth.c @@ -1,5 +1,5 @@ /* Determine display width of UTF-8 string. - Copyright (C) 2001-2002, 2006, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This file is free software. diff --git a/lib/uniwidth/u8-width.c b/lib/uniwidth/u8-width.c index a4df4c13..950ef419 100644 --- a/lib/uniwidth/u8-width.c +++ b/lib/uniwidth/u8-width.c @@ -1,5 +1,5 @@ /* Determine display width of UTF-8 string. - Copyright (C) 2001-2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This file is free software. @@ -39,14 +39,12 @@ u8_width (const uint8_t *s, size_t n, const char *encoding) while (s < s_end) { ucs4_t uc; - int w; - s += u8_mbtouc_unsafe (&uc, s, s_end - s); if (uc == 0) break; /* end of string reached */ - w = uc_width (uc, encoding); + int w = uc_width (uc, encoding); if (w >= 0) /* ignore control characters in the string */ width += w; } diff --git a/lib/uniwidth/width.c b/lib/uniwidth/width.c index 5ada88d9..683f5513 100644 --- a/lib/uniwidth/width.c +++ b/lib/uniwidth/width.c @@ -1,5 +1,5 @@ /* Determine display width of Unicode character. - Copyright (C) 2001-2002, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006-2026 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This file is free software: you can redistribute it and/or modify |
