Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1uxT-0002wi-7z for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Aug 2019 16:01:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i1uxR-00065Z-Bf for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Aug 2019 16:01:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i1uxQ-0005zh-Tp for pgsql-hackers@lists.postgresql.org; Sun, 25 Aug 2019 16:01:33 +0000 Received: from fifth.space ([45.32.148.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i1uxO-0006qQ-HD for pgsql-hackers@lists.postgresql.org; Sun, 25 Aug 2019 16:01:31 +0000 Received: from fifth.space (localhost [127.0.0.1]) by fifth.space (OpenSMTPD) with ESMTP id 93ac068f for ; Sun, 25 Aug 2019 18:01:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=fifth.space; h=date:from :to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=ho9S3wOE/Y4L /mp1HYznfxWOyG8=; b=YbLwgc1Z3JWNwJ/Qtglt9tz+VjLTi2pOqDWbiRJ++sul lu6SOKGXuAY4lW3oP63MUcrhBrL2Nowo6QwUjZtxjZ5qk8mgupnURsMKZst1mQl+ v61X+yhMDEdw5qE17sjK13QBQOv6zi7FwFavLC3TgMsbjB+pQpH+0/h9iIKsh37P UQsWT92WHNCgAgP85C2ZDBgToPlomnUySQg1krTBS1KuQlgC5HVhiNnMrm+5oggz W0Uw8IhaxV1VWpL7m53vxta4U0UvLcIVFe4FTVN+aQWSlGJJ372Z2vZeJ14PE+Q4 Q4/h1Gue89DR676O/7Mvsa827WArCqQXA6JAXWRUAQ== DomainKey-Signature: a=rsa-sha1; c=nofws; d=fifth.space; h=date:from:to :subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=dkim; b=hgcnMF 0qSMKeWiaoYbDBUf0m7Un5S9EJKY1lqM5oxld9m04pu1KWLs3QvWPe89xHx5CfTw SVcRe+f5lm19P1Zx71TsOwSFZsGXGL1f360hqdlEOq44V5+kGyXdlM+tryyjFKvM VKlTWrkqbmIxoQCNm09Pum6mBLZ6g0RXqTXjsRqULh9fE6gwqdch/yNDqkUjO/Fe t2/x3RujGPECqij++iHds6TTTNtGUsvstg3RWGv/UlDUOm2t5j0U4gHAnpIS/oX5 Qqns0LXbKjU3Noye6RrAFC+gRO8X36F0F7xWxDssPNl1WbtIfEDYi8SoouRRvwM6 H5RmfR333UrZIytA== Received: from localhost.localdomain ( [IPv6:2a01:e34:ecae:2d51:29d6:6297:bd67:8dee]) by fifth.space (OpenSMTPD) with ESMTPSA id 4251f59a (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Sun, 25 Aug 2019 18:01:27 +0200 (CEST) Date: Sun, 25 Aug 2019 18:01:25 +0200 From: Quentin Rameau To: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Fix missing argument handling in psql getopt Message-ID: <20190825180125.6b7d245f@fifth.space> In-Reply-To: <20190825175338.74ed0f0e@fifth.space> References: <20190825100617.GA6087@fifth.space> <14042.1566745352@sss.pgh.pa.us> <20190825175338.74ed0f0e@fifth.space> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > > Um ... so how would control get there with optind too large? Sorry, I missed the simple explanation for that: As option 'h' is missing an argument, getopt(_long) returns the character '?' which is switched on through variable c, and the program jumps to the '?' case handling.