When searching for the path of the config file we were using config_file

which is the value the user passes with the -f option. If the user didn't
pass a value, this variable will have a value of NULL.
The variable which has the correct path is config_file_path, which will
have the same value provided by config_file if it's a valid file, or
the file if found in one of the default locations.
This commit is contained in:
Martín Marqués
2017-09-19 19:03:56 -03:00
committed by Ian Barwick
parent a89084c6b5
commit 64cebb8b26

View File

@@ -479,11 +479,11 @@ daemonize_process(void)
memset(path, 0, MAXPGPATH);
for (ptr = config_file + strlen(config_file); ptr > config_file; --ptr)
for (ptr = config_file_path + strlen(config_file_path); ptr > config_file_path; --ptr)
{
if (*ptr == '/')
{
strncpy(path, config_file, ptr - config_file);
strncpy(path, config_file_path, ptr - config_file_path);
}
}