From patchwork Tue Jun 4 22:21:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 32986 Received: (qmail 85587 invoked by alias); 4 Jun 2019 22:21:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 85574 invoked by uid 89); 4 Jun 2019 22:21:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=his X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Jun 2019 22:21:31 +0000 Received: by mail-wr1-f67.google.com with SMTP id e16so9190220wrn.1 for ; Tue, 04 Jun 2019 15:21:30 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:4eeb:42ff:feef:f164? ([2001:8a0:f913:f700:4eeb:42ff:feef:f164]) by smtp.gmail.com with ESMTPSA id y17sm41473640wrg.18.2019.06.04.15.21.28 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 15:21:28 -0700 (PDT) Subject: Re: [PATCH v2 04/24] Make check_for_argument skip whitespace after arg itself To: Tom Tromey References: <20190530195333.20448-1-palves@redhat.com> <20190530195333.20448-5-palves@redhat.com> <87h896mrmp.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <654f7363-6bfd-0db5-8b48-ec8b47888304@redhat.com> Date: Tue, 4 Jun 2019 23:21:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <87h896mrmp.fsf@tromey.com> On 6/3/19 7:49 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> Basically every caller of check_for_argument needs to skip space after > Pedro> the argument. This patch makes check_for_argument do it itself. > > Pedro> Suggested by Philippe Waroquiers > > Philippe's recent help-styling series added a new instance of this, so > whoever lands their series last ought to be sure to go fix that up. His series is in, so I made this change: Thanks, Pedro Alves diff --git i/gdb/cli/cli-cmds.c w/gdb/cli/cli-cmds.c index 09f932c2d21..4e33e3e3b72 100644 --- i/gdb/cli/cli-cmds.c +++ w/gdb/cli/cli-cmds.c @@ -1381,9 +1381,6 @@ apropos_command (const char *arg, int from_tty) { bool verbose = arg && check_for_argument (&arg, "-v", 2); - if (verbose) - arg = skip_spaces (arg); - if (arg == NULL || *arg == '\0') error (_("REGEXP string is empty"));