]> granicus.if.org Git - postgresql/commitdiff
Cleanup for canonicalization fixes, from Tom.
authorBruce Momjian <bruce@momjian.us>
Sun, 11 Jul 2004 23:49:51 +0000 (23:49 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 11 Jul 2004 23:49:51 +0000 (23:49 +0000)
src/backend/postmaster/postmaster.c
src/backend/utils/init/miscinit.c
src/backend/utils/misc/guc.c

index 28b1c83fa315cd7df69fe5ae779d4e16fbf0f304..4231ff22d4261a76f314512670c5f0559146b2ab 100644 (file)
@@ -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))
        {
                /*
index b0c5ff82e3863ec2547e5dc186b4c991f7f36bb5..fd1eb6d762b7c729606612f32fa0f21b5739ce22 100644 (file)
@@ -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)
index 91977650b785637bd0d5be965de82a7ab223171a..20bcf10820655eccee42bb863178cfaf257a0510 100644 (file)
@@ -10,7 +10,7 @@
  * Written by Peter Eisentraut <peter_e@gmx.net>.
  *
  * 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;
        }