aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/startup.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-09-06 02:33:47 +0000
committerBruce Momjian <bruce@momjian.us>2002-09-06 02:33:47 +0000
commit847f8b39d745a1d364df49feefdf71ee05c562df (patch)
tree75e46445f1df70d9c7a525168aacaee2a33e68ed /src/bin/psql/startup.c
parent9a9825f96ad701f5b4f1f19da22cbdd712557e85 (diff)
downloadpostgresql-847f8b39d745a1d364df49feefdf71ee05c562df.tar.gz
postgresql-847f8b39d745a1d364df49feefdf71ee05c562df.zip
Fix printf() quote handling and improper exit(), per Tom.
Diffstat (limited to 'src/bin/psql/startup.c')
-rw-r--r--src/bin/psql/startup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 1ab0ac85243..5cdee365889 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.65 2002/09/05 22:05:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.66 2002/09/06 02:33:47 momjian Exp $
*/
#include "postgres_fe.h"
@@ -42,7 +42,7 @@
*/
PsqlSettings pset;
-#define PSQLRC "/.psqlrc"
+#define PSQLRC ".psqlrc"
/*
* Structures to pass information between the option parsing routine
@@ -605,7 +605,7 @@ process_psqlrc(void)
if (home)
{
- psqlrc = malloc(strlen(home) + strlen(PSQLRC) + 1 +
+ psqlrc = malloc(strlen(home) + 1 + strlen(PSQLRC) + 1 +
strlen(PG_VERSION) + 1);
if (!psqlrc)
{
@@ -613,12 +613,12 @@ process_psqlrc(void)
exit(EXIT_FAILURE);
}
- sprintf(psqlrc, "%s" PSQLRC "-" PG_VERSION, home);
+ sprintf(psqlrc, "%s/%s-%s", home, PSQLRC, PG_VERSION);
if (access(psqlrc, R_OK) == 0)
process_file(psqlrc);
else
{
- sprintf(psqlrc, "%s" PSQLRC, home);
+ sprintf(psqlrc, "%s/%s", home, PSQLRC);
if (access(psqlrc, R_OK) == 0)
process_file(psqlrc);
}