1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 1997,2008 Oracle.  All rights reserved.
5 *
6 * $Id: os_rpath.c,v 12.8 2008/01/08 20:58:43 bostic Exp $
7 */
8
9#include "db_config.h"
10
11#include "db_int.h"
12
13/*
14 * __db_rpath --
15 *	Return the last path separator in the path or NULL if none found.
16 *
17 * PUBLIC: char *__db_rpath __P((const char *));
18 */
19char *
20__db_rpath(path)
21	const char *path;
22{
23	const char *s, *last;
24
25	s = path;
26	last = NULL;
27	if (PATH_SEPARATOR[1] != '\0') {
28		for (; s[0] != '\0'; ++s)
29			if (strchr(PATH_SEPARATOR, s[0]) != NULL)
30				last = s;
31	} else
32		for (; s[0] != '\0'; ++s)
33			if (s[0] == PATH_SEPARATOR[0])
34				last = s;
35	return ((char *)last);
36}
37