00001 /*- 00002 * See the file LICENSE for redistribution information. 00003 * 00004 * Copyright (c) 1997-2005 00005 * Sleepycat Software. All rights reserved. 00006 * 00007 * $Id: os_abs.c,v 12.1 2005/06/16 20:23:28 bostic Exp $ 00008 */ 00009 00010 #include "db_config.h" 00011 00012 #include "db_int.h" 00013 00014 /* 00015 * __os_abspath -- 00016 * Return if a path is an absolute path. 00017 */ 00018 int 00019 __os_abspath(path) 00020 const char *path; 00021 { 00022 /* 00023 * !!! 00024 * Check for drive specifications, e.g., "C:". In addition, the path 00025 * separator used by the win32 DB (PATH_SEPARATOR) is \; look for both 00026 * / and \ since these are user-input paths. 00027 */ 00028 if (isalpha(path[0]) && path[1] == ':') 00029 path += 2; 00030 return (path[0] == '/' || path[0] == '\\'); 00031 }