diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-08-18 02:59:12 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-08-18 02:59:12 +0000 |
commit | 1abf13db3c7f1ffa4e40c9f51f7ba76f390e7f06 (patch) | |
tree | ebd668ab6ae559e447a1799bf611c449eb86da23 /src/port/path.c | |
parent | 19cd31b0682d32142edf7599b653d4eff7031a8c (diff) |
Add get_home_path() to use USERPROFILE on Win32 and HOME on Unix.
Diffstat (limited to 'src/port/path.c')
-rw-r--r-- | src/port/path.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/port/path.c b/src/port/path.c index 7e99ec80adc..db5913f387b 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -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 $ * *------------------------------------------------------------------------- */ @@ -371,6 +371,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/ */ static void |