From 56e8571167b42a3a89cb1d5bb1888b7128619fdb Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 9 Jan 2007 17:34:21 +0000 Subject: [PATCH] sync --- strlfun.c | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/strlfun.c b/strlfun.c index b42c669..04734bd 100644 --- a/strlfun.c +++ b/strlfun.c @@ -1,32 +1,34 @@ -/* $MirOS: src/bin/mksh/strlfun.c,v 1.7 2006/11/09 15:02:31 tg Exp $ */ -/* _MirOS: src/lib/libc/string/strlfun.c,v 1.10 2006/11/08 23:18:04 tg Exp $ */ +/* $MirOS: src/bin/mksh/strlfun.c,v 1.8 2007/01/09 17:34:21 tg Exp $ */ +/* $miros: src/lib/libc/string/strlfun.c,v 1.14 2007/01/07 02:11:40 tg Exp $ */ /*- * Copyright (c) 2006 * Thorsten Glaser * - * Licensee is hereby permitted to deal in this work without restric- - * tion, including unlimited rights to use, publicly perform, modify, - * merge, distribute, sell, give away or sublicence, provided all co- - * pyright notices above, these terms and the disclaimer are retained - * in all redistributions or reproduced in accompanying documentation - * or other materials provided with binary redistributions. - * - * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind, - * express, or implied, to the maximum extent permitted by applicable - * law, without malicious intent or gross negligence; in no event may - * licensor, an author or contributor be held liable for any indirect - * or other damage, or direct damage except proven a consequence of a - * direct error of said person and intended use of this work, loss or - * other issues arising in any way out of its use, even if advised of - * the possibility of such damage or existence of a defect. + * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to + * the utmost extent permitted by applicable law, neither express nor + * implied; without malicious intent or gross negligence. In no event + * may a licensor, author or contributor be held liable for indirect, + * direct, other damage, loss, or other issues arising in any way out + * of dealing in the work, even if advised of the possibility of such + * damage or existence of a defect, except proven that it results out + * of said person's immediate fault when using the work as intended. *- * The strlcat() code below has been written by Thorsten Glaser. Bodo * Eggert suggested optimising the strlcpy() code, originally written * by Todd C. Miller (see below), which was carried out by Th. Glaser - * as well as writing wcslcat() and wcslcpy() equivalents. + * as well as merging this code with strxfrm() for ISO-10646-only sy- + * stems and writing wcslcat(), wcslcpy() and wcsxfrm() equivalents. */ +#ifdef STRXFRM +#undef HAVE_STRLCPY +#undef HAVE_STRLCAT +#define HAVE_STRLCPY 0 +#define HAVE_STRLCAT 1 +#define strlcpy strxfrm +#endif + #include #if defined(_KERNEL) || defined(_STANDALONE) #include @@ -41,7 +43,6 @@ #include "config.h" #endif #endif -extern size_t strlen(const char *); #endif #ifndef __RCSID @@ -71,7 +72,9 @@ extern size_t strlen(const char *); #define __predict_false(exp) ((exp) != 0) #endif -__RCSID("$MirOS: src/bin/mksh/strlfun.c,v 1.7 2006/11/09 15:02:31 tg Exp $"); +#if !defined(_KERNEL) && !defined(_STANDALONE) +__RCSID("$MirOS: src/bin/mksh/strlfun.c,v 1.8 2007/01/09 17:34:21 tg Exp $"); +#endif size_t strlcpy(char *, const char *, size_t);