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
committed by Ian Barwick
parent 0abfde3773
commit 0c82278fd4

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);