From 40360d8c38761dc814ec923ad8377c138c539313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 2 Nov 2004 01:49:54 +0000 Subject: [PATCH] Added stpcpy() implementation for the sake of compatibility (it's not a POSIX function). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9735 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/posix/string/Jamfile | 1 + src/kernel/libroot/posix/string/stpcpy.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/kernel/libroot/posix/string/stpcpy.c diff --git a/src/kernel/libroot/posix/string/Jamfile b/src/kernel/libroot/posix/string/Jamfile index 9c3fe3bf0c..d1a4e51146 100644 --- a/src/kernel/libroot/posix/string/Jamfile +++ b/src/kernel/libroot/posix/string/Jamfile @@ -8,6 +8,7 @@ KernelMergeObject posix_string.o : memcpy.c memmove.c memset.c + stpcpy.c strcasecmp.c strcasestr.c strcat.c diff --git a/src/kernel/libroot/posix/string/stpcpy.c b/src/kernel/libroot/posix/string/stpcpy.c new file mode 100644 index 0000000000..13f29cb680 --- /dev/null +++ b/src/kernel/libroot/posix/string/stpcpy.c @@ -0,0 +1,21 @@ +/* +** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the Haiku License. +*/ + + +#include +#include + + +/* This is not a POSIX function, but since BeOS exports it, we need to, as well. */ + +char * +stpcpy(char *dest, char const *src) +{ + while ((*dest++ = *src++) != '\0') + ; + + return dest - 1; +} +