Update.
[glibc.git] / db2 / os / os_rpath.c
blob23867b35aca33802d05c64775969ee252296450b
1 /*-
2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1997, 1998
5 * Sleepycat Software. All rights reserved.
6 */
8 #include "config.h"
10 #ifndef lint
11 static const char sccsid[] = "@(#)os_rpath.c 10.3 (Sleepycat) 4/10/98";
12 #endif /* not lint */
14 #ifndef NO_SYSTEM_INCLUDES
15 #include <string.h>
16 #endif
18 #include "db_int.h"
21 * __db_rpath --
22 * Return the last path separator in the path or NULL if none found.
24 * PUBLIC: char *__db_rpath __P((const char *));
26 char *
27 __db_rpath(path)
28 const char *path;
30 const char *s, *last;
32 last = NULL;
33 if (PATH_SEPARATOR[1] != '\0') {
34 for (s = path; s[0] != '\0'; ++s)
35 if (strchr(PATH_SEPARATOR, s[0]) != NULL)
36 last = s;
37 } else
38 for (s = path; s[0] != '\0'; ++s)
39 if (s[0] == PATH_SEPARATOR[0])
40 last = s;
41 return ((char *)last);