gecko-dev/db/os.win32/os_abs.c
1998-10-15 03:56:37 +00:00

34 lines
707 B
C

/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1997, 1998
* Sleepycat Software. All rights reserved.
*/
#include "config.h"
#ifndef lint
static const char sccsid[] = "@(#)os_abs.c 10.9 (Sleepycat) 4/10/98";
#endif /* not lint */
#include "db_int.h"
/*
* __db_abspath --
* Return if a path is an absolute path.
*/
int
__db_abspath(path)
const char *path;
{
/*
* !!!
* Check for drive specifications, e.g., "C:". In addition, the path
* separator used by the win32 DB (PATH_SEPARATOR) is \; look for both
* / and \ since these are user-input paths.
*/
if (isalpha(path[0]) && path[1] == ':')
path += 2;
return (path[0] == '/' || path[0] == '\\');
}