1N/A/*-
1N/A * See the file LICENSE for redistribution information.
1N/A *
1N/A * Copyright (c) 1997
1N/A * Sleepycat Software. All rights reserved.
1N/A */
1N/A/*
1N/A * Copyright (c) 1998 by Sun Microsystems, Inc.
1N/A * All rights reserved.
1N/A */
1N/A
1N/A#include "config.h"
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A#ifndef lint
1N/Astatic const char sccsid[] = "@(#)os_rpath.c 10.2 (Sleepycat) 10/24/97";
1N/Astatic const char sccsi2[] = "%W% (Sun) %G%";
1N/A#endif /* not lint */
1N/A
1N/A#ifndef NO_SYSTEM_INCLUDES
1N/A#include <string.h>
1N/A#endif
1N/A
1N/A#include "db_int.h"
1N/A
1N/A/*
1N/A * __db_rpath --
1N/A * Return the last path separator in the path or NULL if none found.
1N/A *
1N/A * PUBLIC: char *__db_rpath __P((const char *));
1N/A */
1N/Achar *
1N/A__db_rpath(path)
1N/A const char *path;
1N/A{
1N/A const char *s, *last;
1N/A
1N/A last = NULL;
1N/A if (PATH_SEPARATOR[1] != '\0') {
1N/A for (s = path; s[0] != '\0'; ++s)
1N/A if (strchr(PATH_SEPARATOR, s[0]) != NULL)
1N/A last = s;
1N/A } else
1N/A for (s = path; s[0] != '\0'; ++s)
1N/A if (s[0] == PATH_SEPARATOR[0])
1N/A last = s;
1N/A return ((char *)last);
1N/A}