1 /* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
2 
3 This library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Library General Public License as
5 published by the Free Software Foundation; either version 2 of the
6 License, or (at your option) any later version.
7 
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 Library General Public License for more details.
12 
13 You should have received a copy of the GNU Library General Public
14 License along with this library; see the file COPYING.LIB.  If
15 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
16 Suite 500, Boston, MA 02110-1335, USA.  */
17 
18 /* Required to tell conf.h not to include the standard ProFTPD
19  * header files
20  */
21 
22 #define __PROFTPD_SUPPORT_LIBRARY
23 
24 #include <conf.h>
25 
26 #include <libsupp.h>
27 
28 #undef _LIBC
29 #undef __GNU_LIBRARY__
30 #if defined (_LIBC) || !defined (__GNU_LIBRARY__)
31 
32 
33 #if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
34 extern int errno;
35 #endif
36 
37 #ifndef HAVE_STRSEP
38 /* Match STRING against the filename pattern PATTERN, returning zero if
39    it matches, nonzero if not.  */
40 char
strsep(char ** stringp,const char * delim)41 *strsep(char **stringp, const char *delim)
42 {
43   char *res;
44 
45   if (!stringp || !*stringp || !**stringp)
46     return (char*)0;
47 
48   res = *stringp;
49   while(**stringp && !strchr(delim, **stringp))
50     ++(*stringp);
51 
52   if (**stringp) {
53     **stringp = '\0';
54     ++(*stringp);
55   }
56 
57   return res;
58 }
59 #else
60 void
pr_os_already_has_strsep(void)61 pr_os_already_has_strsep(void)
62 {
63 }
64 #endif  /* HAVE_STRSEP */
65 
66 #endif	/* _LIBC or not __GNU_LIBRARY__.  */
67