From 421089dc3538d688fdfb9ef92efc3b0e7052013c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 11 Jul 2004 23:49:51 +0000 Subject: [PATCH] Cleanup for canonicalization fixes, from Tom. --- src/backend/postmaster/postmaster.c | 9 +++++++-- src/backend/utils/init/miscinit.c | 6 +----- src/backend/utils/misc/guc.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 28b1c83fa3..4231ff22d4 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.408 2004/07/11 21:33:59 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.409 2004/07/11 23:49:45 momjian Exp $ * * NOTES * @@ -372,7 +372,6 @@ PostmasterMain(int argc, char *argv[]) InitializeGUCOptions(); userPGDATA = getenv("PGDATA"); /* default value */ - canonicalize_path(userPGDATA); opterr = 1; @@ -526,6 +525,12 @@ PostmasterMain(int argc, char *argv[]) ExitPostmaster(1); } + if (userPGDATA) + { + userPGDATA = strdup(userPGDATA); + canonicalize_path(userPGDATA); + } + if (onlyConfigSpecified(userPGDATA)) { /* diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index b0c5ff82e3..fd1eb6d762 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.127 2004/06/18 06:13:54 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/init/miscinit.c,v 1.128 2004/07/11 23:49:48 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -207,10 +207,6 @@ SetDataDir(const char *dir) errmsg("out of memory"))); } - /* - * Strip any trailing slash. Not strictly necessary, but avoids - * generating funny-looking paths to individual files. - */ canonicalize_path(new); if (DataDir) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 91977650b7..20bcf10820 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut . * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.216 2004/07/11 21:48:25 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.217 2004/07/11 23:49:51 momjian Exp $ * *-------------------------------------------------------------------- */ @@ -5441,7 +5441,7 @@ assign_canonical_path(const char *newval, bool doit, GucSource source) if (doit) { /* We have to create a new pointer to force the change */ - char *canon_val = guc_strdup(FATAL, newval); + char *canon_val = guc_strdup(ERROR, newval); canonicalize_path(canon_val); return canon_val; } -- 2.40.0