postgresql-10.0/src/bin/psql/mainloop.c:465: suspicious condition ?

From: David Binderman <dcb314(at)hotmail(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: postgresql-10.0/src/bin/psql/mainloop.c:465: suspicious condition ?
Date: 2017-10-06 07:21:33
Message-ID: HE1PR0802MB233122B61F00A15E035C83BE9C710@HE1PR0802MB2331.eurprd08.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello there,

postgresql-10.0/src/bin/psql/mainloop.c:461] -> [postgresql-10.0/src/bin/psql/mainloop.c:465]: (warning) Opposite inner 'if' condition leads to a dead code block.

Source code is

if (query_buf->len > 0 && !pset.cur_cmd_interactive &&
successResult == EXIT_SUCCESS)
{
/* save query in history */
if (pset.cur_cmd_interactive)
pg_send_history(history_buf);

It looks like function pg_send_history can never be executed.

Regards

David Binderman

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message buschmann 2017-10-06 11:04:19 BUG #14844: Failure/Duplicate key value with ALTER DATABASE set search_path
Previous Message Noah Misch 2017-10-06 05:50:20 Re: BUG #14794: Installation failure if user specify French password