Mercurial > hg > octave-kai > gnulib-hg
annotate lib/stpcpy.c @ 9309:bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 07 Oct 2007 19:14:58 +0200 |
parents | 44fe37f21d92 |
children | b5e42ef33b49 |
rev | line source |
---|---|
1293
2bb4c9c36a9f
add descriptive first-line comment
Jim Meyering <jim@meyering.net>
parents:
1110
diff
changeset
|
1 /* stpcpy.c -- copy a string and return pointer to end of new string |
7304
1c4ed7637c24
Include <config.h> unconditionally.
Bruno Haible <bruno@clisp.org>
parents:
7025
diff
changeset
|
2 Copyright (C) 1992, 1995, 1997-1998, 2006 Free Software Foundation, Inc. |
1014 | 3 |
1110 | 4 NOTE: The canonical source of this file is maintained with the GNU C Library. |
5 Bugs can be reported to bug-glibc@prep.ai.mit.edu. | |
5 | 6 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7473
diff
changeset
|
7 This program is free software: you can redistribute it and/or modify it |
1110 | 8 under the terms of the GNU General Public License as published by the |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7473
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or any |
1110 | 10 later version. |
5 | 11 |
1110 | 12 This program is distributed in the hope that it will be useful, |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
5 | 16 |
1110 | 17 You should have received a copy of the GNU General Public License |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7473
diff
changeset
|
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
5 | 19 |
7304
1c4ed7637c24
Include <config.h> unconditionally.
Bruno Haible <bruno@clisp.org>
parents:
7025
diff
changeset
|
20 #include <config.h> |
1018 | 21 |
1014 | 22 #include <string.h> |
23 | |
1110 | 24 #undef __stpcpy |
7473
44fe37f21d92
Make it possible to alias stpcpy and strdup.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
25 #ifdef _LIBC |
44fe37f21d92
Make it possible to alias stpcpy and strdup.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
26 # undef stpcpy |
44fe37f21d92
Make it possible to alias stpcpy and strdup.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
27 #endif |
1110 | 28 |
1014 | 29 #ifndef weak_alias |
30 # define __stpcpy stpcpy | |
328 | 31 #endif |
32 | |
33 /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ | |
5 | 34 char * |
1557 | 35 __stpcpy (char *dest, const char *src) |
5 | 36 { |
1014 | 37 register char *d = dest; |
38 register const char *s = src; | |
39 | |
40 do | |
41 *d++ = *s; | |
42 while (*s++ != '\0'); | |
43 | |
44 return d - 1; | |
5 | 45 } |
1014 | 46 #ifdef weak_alias |
47 weak_alias (__stpcpy, stpcpy) | |
48 #endif |