Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lGvEM-0000rv-6C for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Mar 2021 02:57:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lGvEK-0006r8-6Y for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Mar 2021 02:57:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lGvEJ-0006qz-Vo for pgsql-hackers@lists.postgresql.org; Tue, 02 Mar 2021 02:57:47 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lGvEC-0001Ef-Uw for pgsql-hackers@postgresql.org; Tue, 02 Mar 2021 02:57:46 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTP id 9CA49602FD for ; Tue, 2 Mar 2021 11:57:37 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_a092ac5698d16453aac98682bd6c509b" Date: Tue, 02 Mar 2021 11:57:37 +0900 From: miyake_kouta To: Pgsql Hackers Subject: [PATCH] psql : Improve code for help option Message-ID: <2a3c612babdd6ed63a9d877bb575d793@oss.nttdata.com> X-Sender: miyake_kouta@oss.nttdata.com User-Agent: Roundcube Webmail/1.1.9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_a092ac5698d16453aac98682bd6c509b Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hi. I found some redundant code in psql/help.c, so I propose a patch to fix it. In the current help.c, the variable "user" is set to the value of $PGUSER (or get_user_name). However, $PGUSER is referenced again in the code that follows. We can replace this part with "user", I think. Regards. -- Kota Miyake --=_a092ac5698d16453aac98682bd6c509b Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=psql_help.patch Content-Disposition: attachment; filename=psql_help.patch; size=698 ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcHNxbC9oZWxwLmMgYi9zcmMvYmluL3BzcWwvaGVscC5jCmlu ZGV4IGU0NDEyMGJmNzYuLjc1YTIyMTdjYWMgMTAwNjQ0Ci0tLSBhL3NyYy9iaW4vcHNxbC9oZWxw LmMKKysrIGIvc3JjL2Jpbi9wc3FsL2hlbHAuYwpAQCAtMTM0LDkgKzEzNCw3IEBAIHVzYWdlKHVu c2lnbmVkIHNob3J0IGludCBwYWdlcikKIAlmcHJpbnRmKG91dHB1dCwgXygiICAtcCwgLS1wb3J0 PVBPUlQgICAgICAgICAgZGF0YWJhc2Ugc2VydmVyIHBvcnQgKGRlZmF1bHQ6IFwiJXNcIilcbiIp LAogCQkJZW52ID8gZW52IDogREVGX1BHUE9SVF9TVFIpOwogCS8qIERpc3BsYXkgZGVmYXVsdCB1 c2VyICovCi0JZW52ID0gZ2V0ZW52KCJQR1VTRVIiKTsKLQlpZiAoIWVudikKLQkJZW52ID0gdXNl cjsKKwllbnYgPSB1c2VyOwogCWZwcmludGYob3V0cHV0LCBfKCIgIC1VLCAtLXVzZXJuYW1lPVVT RVJOQU1FICBkYXRhYmFzZSB1c2VyIG5hbWUgKGRlZmF1bHQ6IFwiJXNcIilcbiIpLCBlbnYpOwog CWZwcmludGYob3V0cHV0LCBfKCIgIC13LCAtLW5vLXBhc3N3b3JkICAgICAgICBuZXZlciBwcm9t cHQgZm9yIHBhc3N3b3JkXG4iKSk7CiAJZnByaW50ZihvdXRwdXQsIF8oIiAgLVcsIC0tcGFzc3dv cmQgICAgICAgICAgIGZvcmNlIHBhc3N3b3JkIHByb21wdCAoc2hvdWxkIGhhcHBlbiBhdXRvbWF0 aWNhbGx5KVxuIikpOwo= --=_a092ac5698d16453aac98682bd6c509b--