Commit 5dafb69e authored by Bruce Momjian's avatar Bruce Momjian

Re-order 'else' clause for clarity.

parent b4176e9f
...@@ -10,7 +10,7 @@ ...@@ -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.262 2005/05/15 00:26:19 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.263 2005/05/27 18:33:30 momjian Exp $
* *
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
...@@ -2500,7 +2500,13 @@ SelectConfigFiles(const char *userDoption, const char *progname) ...@@ -2500,7 +2500,13 @@ SelectConfigFiles(const char *userDoption, const char *progname)
*/ */
if (ConfigFileName) if (ConfigFileName)
fname = make_absolute_path(ConfigFileName); fname = make_absolute_path(ConfigFileName);
else if (!configdir) else if (configdir)
{
fname = guc_malloc(FATAL,
strlen(configdir) + strlen(CONFIG_FILENAME) + 2);
sprintf(fname, "%s/%s", configdir, CONFIG_FILENAME);
}
else
{ {
write_stderr("%s does not know where to find the server configuration file.\n" write_stderr("%s does not know where to find the server configuration file.\n"
"You must specify the --config-file or -D invocation " "You must specify the --config-file or -D invocation "
...@@ -2508,12 +2514,6 @@ SelectConfigFiles(const char *userDoption, const char *progname) ...@@ -2508,12 +2514,6 @@ SelectConfigFiles(const char *userDoption, const char *progname)
progname); progname);
return false; return false;
} }
else
{
fname = guc_malloc(FATAL,
strlen(configdir) + strlen(CONFIG_FILENAME) + 2);
sprintf(fname, "%s/%s", configdir, CONFIG_FILENAME);
}
/* /*
* Set the ConfigFileName GUC variable to its final value, ensuring * Set the ConfigFileName GUC variable to its final value, ensuring
...@@ -2568,7 +2568,13 @@ SelectConfigFiles(const char *userDoption, const char *progname) ...@@ -2568,7 +2568,13 @@ SelectConfigFiles(const char *userDoption, const char *progname)
*/ */
if (HbaFileName) if (HbaFileName)
fname = make_absolute_path(HbaFileName); fname = make_absolute_path(HbaFileName);
else if (!configdir) else if (configdir)
{
fname = guc_malloc(FATAL,
strlen(configdir) + strlen(HBA_FILENAME) + 2);
sprintf(fname, "%s/%s", configdir, HBA_FILENAME);
}
else
{ {
write_stderr("%s does not know where to find the \"hba\" configuration file.\n" write_stderr("%s does not know where to find the \"hba\" configuration file.\n"
"This can be specified as \"hba_file\" in \"%s\", " "This can be specified as \"hba_file\" in \"%s\", "
...@@ -2577,12 +2583,6 @@ SelectConfigFiles(const char *userDoption, const char *progname) ...@@ -2577,12 +2583,6 @@ SelectConfigFiles(const char *userDoption, const char *progname)
progname, ConfigFileName); progname, ConfigFileName);
return false; return false;
} }
else
{
fname = guc_malloc(FATAL,
strlen(configdir) + strlen(HBA_FILENAME) + 2);
sprintf(fname, "%s/%s", configdir, HBA_FILENAME);
}
SetConfigOption("hba_file", fname, PGC_POSTMASTER, PGC_S_OVERRIDE); SetConfigOption("hba_file", fname, PGC_POSTMASTER, PGC_S_OVERRIDE);
free(fname); free(fname);
...@@ -2591,7 +2591,13 @@ SelectConfigFiles(const char *userDoption, const char *progname) ...@@ -2591,7 +2591,13 @@ SelectConfigFiles(const char *userDoption, const char *progname)
*/ */
if (IdentFileName) if (IdentFileName)
fname = make_absolute_path(IdentFileName); fname = make_absolute_path(IdentFileName);
else if (!configdir) else if (configdir)
{
fname = guc_malloc(FATAL,
strlen(configdir) + strlen(IDENT_FILENAME) + 2);
sprintf(fname, "%s/%s", configdir, IDENT_FILENAME);
}
else
{ {
write_stderr("%s does not know where to find the \"ident\" configuration file.\n" write_stderr("%s does not know where to find the \"ident\" configuration file.\n"
"This can be specified as \"ident_file\" in \"%s\", " "This can be specified as \"ident_file\" in \"%s\", "
...@@ -2600,12 +2606,6 @@ SelectConfigFiles(const char *userDoption, const char *progname) ...@@ -2600,12 +2606,6 @@ SelectConfigFiles(const char *userDoption, const char *progname)
progname, ConfigFileName); progname, ConfigFileName);
return false; return false;
} }
else
{
fname = guc_malloc(FATAL,
strlen(configdir) + strlen(IDENT_FILENAME) + 2);
sprintf(fname, "%s/%s", configdir, IDENT_FILENAME);
}
SetConfigOption("ident_file", fname, PGC_POSTMASTER, PGC_S_OVERRIDE); SetConfigOption("ident_file", fname, PGC_POSTMASTER, PGC_S_OVERRIDE);
free(fname); free(fname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment