diff options
Diffstat (limited to 'db-4.8.30/os_windows/os_abs.c')
-rw-r--r-- | db-4.8.30/os_windows/os_abs.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/db-4.8.30/os_windows/os_abs.c b/db-4.8.30/os_windows/os_abs.c new file mode 100644 index 0000000..4ab39f5 --- /dev/null +++ b/db-4.8.30/os_windows/os_abs.c @@ -0,0 +1,30 @@ +/*- + * See the file LICENSE for redistribution information. + * + * Copyright (c) 1997-2009 Oracle. All rights reserved. + * + * $Id$ + */ + +#include "db_config.h" + +#include "db_int.h" + +/* + * __os_abspath -- + * Return if a path is an absolute path. + */ +int +__os_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] == '\\'); +} |