1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Add get_home_path() to use USERPROFILE on Win32 and HOME on Unix.

This commit is contained in:
Bruce Momjian
2004-08-18 02:59:12 +00:00
parent 19cd31b068
commit 1abf13db3c
6 changed files with 47 additions and 25 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/path.c,v 1.30 2004/08/13 14:47:23 tgl Exp $
* $PostgreSQL: pgsql/src/port/path.c,v 1.31 2004/08/18 02:59:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -370,6 +370,27 @@ set_pglocale_pgservice(const char *argv0, const char *app)
}
/*
* get_include_path
*/
bool
get_home_path(char *ret_path)
{
if (getenv(HOMEDIR) == NULL)
{
*ret_path = '\0';
return false;
}
else
{
StrNCpy(ret_path, getenv(HOMEDIR), MAXPGPATH);
canonicalize_path(ret_path);
return true;
}
}
/*
* make_relative - adjust path to be relative to bin/
*/