diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-06-17 20:40:33 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-06-17 20:40:33 +0000 |
commit | be7004e483155fec9dc1404ce22b9bf05c193127 (patch) | |
tree | 324b7c12f3d62c06a7c4873e563b9c5491af99e4 /lib/libc/locale | |
parent | bca5a28b4734025b47828589f2a0704cc7e1d9e9 (diff) |
next citrus step.
reviewed by millert, otto, kevlo, naddy, kettenis...
libc+libstdc++ bump
Diffstat (limited to 'lib/libc/locale')
-rw-r--r-- | lib/libc/locale/multibyte_sb.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/libc/locale/multibyte_sb.c b/lib/libc/locale/multibyte_sb.c index 4ff06614b3f..3213766e84b 100644 --- a/lib/libc/locale/multibyte_sb.c +++ b/lib/libc/locale/multibyte_sb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: multibyte_sb.c,v 1.1 2005/05/11 18:44:12 espie Exp $ */ +/* $OpenBSD: multibyte_sb.c,v 1.2 2005/06/17 20:40:32 espie Exp $ */ /* $NetBSD: multibyte_sb.c,v 1.4 2003/08/07 16:43:04 agc Exp $ */ /* @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: multibyte_sb.c,v 1.1 2005/05/11 18:44:12 espie Exp $"; +static char rcsid[] = "$OpenBSD: multibyte_sb.c,v 1.2 2005/06/17 20:40:32 espie Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -224,3 +224,20 @@ wctob(wint_t c) return EOF; return (int)c; } + +int +wcscoll(const wchar_t *s1, const wchar_t *s2) +{ + while (*s1 == *s2++) + if (*s1++ == 0) + return (0); + return ((unsigned char)(*s1) - (unsigned char)(*--s2)); +} + +size_t +wcsxfrm(wchar_t *dest, const wchar_t *src, size_t n) +{ + if (n == 0) + return wcslen(src); + return wcslcpy(dest, src, n); +} |