8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / sendmail / db / os / os_rpath.c
blob4b0cbe1c3c0eaec4f1dbddc29ad707ee397f19b0
1 /*-
2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1997
5 * Sleepycat Software. All rights reserved.
6 */
7 /*
8 * Copyright (c) 1998 by Sun Microsystems, Inc.
9 * All rights reserved.
12 #include "config.h"
14 #pragma ident "%Z%%M% %I% %E% SMI"
16 #ifndef lint
17 static const char sccsid[] = "@(#)os_rpath.c 10.2 (Sleepycat) 10/24/97";
18 static const char sccsi2[] = "%W% (Sun) %G%";
19 #endif /* not lint */
21 #ifndef NO_SYSTEM_INCLUDES
22 #include <string.h>
23 #endif
25 #include "db_int.h"
28 * __db_rpath --
29 * Return the last path separator in the path or NULL if none found.
31 * PUBLIC: char *__db_rpath __P((const char *));
33 char *
34 __db_rpath(path)
35 const char *path;
37 const char *s, *last;
39 last = NULL;
40 if (PATH_SEPARATOR[1] != '\0') {
41 for (s = path; s[0] != '\0'; ++s)
42 if (strchr(PATH_SEPARATOR, s[0]) != NULL)
43 last = s;
44 } else
45 for (s = path; s[0] != '\0'; ++s)
46 if (s[0] == PATH_SEPARATOR[0])
47 last = s;
48 return ((char *)last);