mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Add Win32 path handling for / vs. \ and drive letters.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.111 2003/04/04 20:40:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.112 2003/04/04 20:42:12 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -698,9 +698,9 @@ resolve_alt_dbpath(const char *dbpath, Oid dboid)
|
||||
if (dbpath == NULL || dbpath[0] == '\0')
|
||||
return NULL;
|
||||
|
||||
if (strchr(dbpath, '/'))
|
||||
if (first_path_separator(dbpath))
|
||||
{
|
||||
if (dbpath[0] != '/')
|
||||
if (!is_absolute_path(dbpath))
|
||||
elog(ERROR, "Relative paths are not allowed as database locations");
|
||||
#ifndef ALLOW_ABSOLUTE_DBPATHS
|
||||
elog(ERROR, "Absolute paths are not allowed as database locations");
|
||||
@ -714,7 +714,7 @@ resolve_alt_dbpath(const char *dbpath, Oid dboid)
|
||||
|
||||
if (!var)
|
||||
elog(ERROR, "Postmaster environment variable '%s' not set", dbpath);
|
||||
if (var[0] != '/')
|
||||
if (!is_absolute_path(var))
|
||||
elog(ERROR, "Postmaster environment variable '%s' must be absolute path", dbpath);
|
||||
prefix = var;
|
||||
}
|
||||
|
Reference in New Issue
Block a user