repmgr: fix command line parsing with hostname as an additional argument

Check explicitly whether -h/--hostname provided, otherwise PGHOST,
if set, will be misinterpreted.
This commit is contained in:
Ian Barwick
2017-03-14 22:52:15 +09:00
parent ea6fff7827
commit b154a5c155

View File

@@ -758,7 +758,7 @@ main(int argc, char **argv)
{
if (optind < argc)
{
if (runtime_options.host[0])
if (runtime_options.host_param_provided == true)
{
PQExpBufferData additional_host_arg;
initPQExpBuffer(&additional_host_arg);