Mercurial > gnulib
annotate lib/stpcpy.c @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
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 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2013 Free Software |
12559
c2cbabec01dd
update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents:
12518
diff
changeset
|
3 Foundation, Inc. |
1014 | 4 |
1110 | 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. | |
5 | 7 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7473
diff
changeset
|
8 This program is free software: you can redistribute it and/or modify it |
1110 | 9 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
|
10 Free Software Foundation; either version 3 of the License, or any |
1110 | 11 later version. |
5 | 12 |
1110 | 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. | |
5 | 17 |
1110 | 18 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
|
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
5 | 20 |
7304
1c4ed7637c24
Include <config.h> unconditionally.
Bruno Haible <bruno@clisp.org>
parents:
7025
diff
changeset
|
21 #include <config.h> |
1018 | 22 |
1014 | 23 #include <string.h> |
24 | |
1110 | 25 #undef __stpcpy |
7473
44fe37f21d92
Make it possible to alias stpcpy and strdup.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
26 #ifdef _LIBC |
44fe37f21d92
Make it possible to alias stpcpy and strdup.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
27 # undef stpcpy |
44fe37f21d92
Make it possible to alias stpcpy and strdup.
Bruno Haible <bruno@clisp.org>
parents:
7304
diff
changeset
|
28 #endif |
1110 | 29 |
1014 | 30 #ifndef weak_alias |
31 # define __stpcpy stpcpy | |
328 | 32 #endif |
33 | |
34 /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ | |
5 | 35 char * |
1557 | 36 __stpcpy (char *dest, const char *src) |
5 | 37 { |
1014 | 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; | |
5 | 46 } |
1014 | 47 #ifdef weak_alias |
48 weak_alias (__stpcpy, stpcpy) | |
49 #endif |