mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Add Win32 path handling for / vs. \ and drive letters.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.101 2003/03/20 04:51:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.102 2003/04/04 20:42:12 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -134,7 +134,7 @@ SetDataDir(const char *dir)
|
||||
AssertArg(dir);
|
||||
|
||||
/* If presented path is relative, convert to absolute */
|
||||
if (dir[0] != '/')
|
||||
if (!is_absolute_path(dir))
|
||||
{
|
||||
char *buf;
|
||||
size_t buflen;
|
||||
@ -179,7 +179,11 @@ SetDataDir(const char *dir)
|
||||
* generating funny-looking paths to individual files.
|
||||
*/
|
||||
newlen = strlen(new);
|
||||
if (newlen > 1 && new[newlen - 1] == '/')
|
||||
if (newlen > 1 && new[newlen - 1] == '/'
|
||||
#ifdef WIN32
|
||||
|| new[newlen - 1] == '\\'
|
||||
#endif
|
||||
)
|
||||
new[newlen - 1] = '\0';
|
||||
|
||||
if (DataDir)
|
||||
|
Reference in New Issue
Block a user