summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-connect.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-08-18 02:59:12 +0000
committerBruce Momjian <bruce@momjian.us>2004-08-18 02:59:12 +0000
commit1abf13db3c7f1ffa4e40c9f51f7ba76f390e7f06 (patch)
treeebd668ab6ae559e447a1799bf611c449eb86da23 /src/interfaces/libpq/fe-connect.c
parent19cd31b0682d32142edf7599b653d4eff7031a8c (diff)
Add get_home_path() to use USERPROFILE on Win32 and HOME on Unix.
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r--src/interfaces/libpq/fe-connect.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index b560f358a6c..319563d92ea 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.280 2004/08/17 04:24:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.281 2004/08/18 02:59:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3093,7 +3093,7 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
{
FILE *fp;
char *pgpassfile;
- char *home;
+ char home[MAXPGPATH];
struct stat stat_buf;
#define LINELEN NAMEDATALEN*5
@@ -3112,8 +3112,7 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
port = DEF_PGPORT_STR;
/* Look for it in the home dir */
- home = getenv("HOME");
- if (!home)
+ if (!get_home_path(home))
return NULL;
pgpassfile = malloc(strlen(home) + 1 + strlen(PGPASSFILE) + 1);