Cleanup for canonicalization fixes, from Tom.

This commit is contained in:
Bruce Momjian 2004-07-11 23:49:51 +00:00
parent a1f3209c07
commit 421089dc35
3 changed files with 10 additions and 9 deletions

View File

@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* *
@ -372,7 +372,6 @@ PostmasterMain(int argc, char *argv[])
InitializeGUCOptions(); InitializeGUCOptions();
userPGDATA = getenv("PGDATA"); /* default value */ userPGDATA = getenv("PGDATA"); /* default value */
canonicalize_path(userPGDATA);
opterr = 1; opterr = 1;
@ -526,6 +525,12 @@ PostmasterMain(int argc, char *argv[])
ExitPostmaster(1); ExitPostmaster(1);
} }
if (userPGDATA)
{
userPGDATA = strdup(userPGDATA);
canonicalize_path(userPGDATA);
}
if (onlyConfigSpecified(userPGDATA)) if (onlyConfigSpecified(userPGDATA))
{ {
/* /*

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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"))); errmsg("out of memory")));
} }
/*
* Strip any trailing slash. Not strictly necessary, but avoids
* generating funny-looking paths to individual files.
*/
canonicalize_path(new); canonicalize_path(new);
if (DataDir) if (DataDir)

View File

@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* IDENTIFICATION * 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) if (doit)
{ {
/* We have to create a new pointer to force the change */ /* 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); canonicalize_path(canon_val);
return canon_val; return canon_val;
} }