mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
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:
committed by
Ian Barwick
parent
a89084c6b5
commit
64cebb8b26
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user