1
0
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:
Bruce Momjian
2003-04-04 20:42:13 +00:00
parent 9bad936f67
commit d46e643822
22 changed files with 147 additions and 88 deletions

View File

@ -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)