diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gnulib.mk | 11 | ||||
| -rw-r--r-- | lib/stpcpy.c | 49 |
2 files changed, 59 insertions, 1 deletions
diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 740ebb1e96c..27a5964cd7c 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | # the same distribution terms as the rest of that program. | 21 | # the same distribution terms as the rest of that program. |
| 22 | # | 22 | # |
| 23 | # Generated by gnulib-tool. | 23 | # Generated by gnulib-tool. |
| 24 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stddef stdio strftime strtoimax strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings | 24 | # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stddef stdio stpcpy strftime strtoimax strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | MOSTLYCLEANFILES += core *.stackdump | 27 | MOSTLYCLEANFILES += core *.stackdump |
| @@ -1214,6 +1214,15 @@ EXTRA_DIST += stdlib.in.h | |||
| 1214 | 1214 | ||
| 1215 | ## end gnulib module stdlib | 1215 | ## end gnulib module stdlib |
| 1216 | 1216 | ||
| 1217 | ## begin gnulib module stpcpy | ||
| 1218 | |||
| 1219 | |||
| 1220 | EXTRA_DIST += stpcpy.c | ||
| 1221 | |||
| 1222 | EXTRA_libgnu_a_SOURCES += stpcpy.c | ||
| 1223 | |||
| 1224 | ## end gnulib module stpcpy | ||
| 1225 | |||
| 1217 | ## begin gnulib module strftime | 1226 | ## begin gnulib module strftime |
| 1218 | 1227 | ||
| 1219 | libgnu_a_SOURCES += strftime.c | 1228 | libgnu_a_SOURCES += strftime.c |
diff --git a/lib/stpcpy.c b/lib/stpcpy.c new file mode 100644 index 00000000000..880a7061ef1 --- /dev/null +++ b/lib/stpcpy.c | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | /* stpcpy.c -- copy a string and return pointer to end of new string | ||
| 2 | Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2014 Free Software | ||
| 3 | Foundation, Inc. | ||
| 4 | |||
| 5 | NOTE: The canonical source of this file is maintained with the GNU C Library. | ||
| 6 | Bugs can be reported to bug-glibc@prep.ai.mit.edu. | ||
| 7 | |||
| 8 | This program is free software: you can redistribute it and/or modify it | ||
| 9 | under the terms of the GNU General Public License as published by the | ||
| 10 | Free Software Foundation; either version 3 of the License, or any | ||
| 11 | later version. | ||
| 12 | |||
| 13 | This program is distributed in the hope that it will be useful, | ||
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | GNU General Public License for more details. | ||
| 17 | |||
| 18 | You should have received a copy of the GNU General Public License | ||
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
| 20 | |||
| 21 | #include <config.h> | ||
| 22 | |||
| 23 | #include <string.h> | ||
| 24 | |||
| 25 | #undef __stpcpy | ||
| 26 | #ifdef _LIBC | ||
| 27 | # undef stpcpy | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #ifndef weak_alias | ||
| 31 | # define __stpcpy stpcpy | ||
| 32 | #endif | ||
| 33 | |||
| 34 | /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ | ||
| 35 | char * | ||
| 36 | __stpcpy (char *dest, const char *src) | ||
| 37 | { | ||
| 38 | register char *d = dest; | ||
| 39 | register const char *s = src; | ||
| 40 | |||
| 41 | do | ||
| 42 | *d++ = *s; | ||
| 43 | while (*s++ != '\0'); | ||
| 44 | |||
| 45 | return d - 1; | ||
| 46 | } | ||
| 47 | #ifdef weak_alias | ||
| 48 | weak_alias (__stpcpy, stpcpy) | ||
| 49 | #endif | ||