public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: GDB Patches <gdb-patches@sourceware.org>,
	 Jerome Guitton <guitton@adacore.com>
Subject: Re: [PATCH] PR cli/21688: Fix multi-line/inline command differentiation
Date: Fri, 30 Jun 2017 11:16:00 -0000	[thread overview]
Message-ID: <8760fdlo92.fsf@redhat.com> (raw)
In-Reply-To: <725a3a1dc21cf9ad38100468caa83d67@polymtl.ca> (Simon Marchi's	message of "Fri, 30 Jun 2017 09:00:36 +0200")

On Friday, June 30 2017, Simon Marchi wrote:

> On 2017-06-30 00:21, Sergio Durigan Junior wrote:
>> On Thursday, June 29 2017, Simon Marchi wrote:
>>
>>> On 2017-06-29 21:48, Sergio Durigan Junior wrote:
>>>> On Thursday, June 29 2017, Simon Marchi wrote:
>>>>> Another (maybe simpler) way would be to check
>>>>>
>>>>>   else if (command_name_equals (cmd, "python") && *cmd_name == '\0')
>>>>>
>>>>> It's not clear when expressed like this though because cmd_name
>>>>> is not
>>>>> well named at this point (it points just after the command name).
>>>>
>>>> Hm, right.  Would you prefer this way instead?  I don't have a strong
>>>> opinion on this.
>>>
>>> My opinion is the solution with the least code is probably best, if
>>> they are equivalent otherwise, but I don't really mind.  It's just a
>>> suggestion.
>>
>> Right.  I did some more tests here, and unfortunately your solution
>> doesn't work for all cases.  For example, if the user puts trailing
>> whitespace on the command name (like "python "), *cmd_name will
>> point to
>> a whitespace after the call to lookup_cmd_1.
>
> Ah, I got confused because there's some code that strips trailing
> whitespaces, but it only set p_end, it doesn't modify the string.

Yeah.  Another option would be to advance cmd_name until there is no
more whitespace-like char.  Anyway...

>> So here's second version of the patch, with the fixes you requested
>> except the one above.  WDYT?
>
> That LGTM.

Thanks, pushed.

51ed89aa0dce3db46561235efdc4bbc0661bcf37

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

  reply	other threads:[~2017-06-30 11:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  2:05 Sergio Durigan Junior
2017-06-29 12:51 ` Jerome Guitton
2017-06-29 19:08 ` Simon Marchi
2017-06-29 19:48   ` Sergio Durigan Junior
2017-06-29 21:06     ` Simon Marchi
2017-06-29 22:21       ` Sergio Durigan Junior
2017-06-30  7:01         ` Simon Marchi
2017-06-30 11:16           ` Sergio Durigan Junior [this message]
2017-06-30 11:14         ` Pedro Alves
2017-06-30 11:24           ` Sergio Durigan Junior
2017-06-30 11:30             ` Pedro Alves
2017-06-30 12:33               ` Sergio Durigan Junior
2017-06-30 12:34               ` [PATCH] PR cli/21688: Detect aliases when issuing python/compile/guile commands (and fix last commit) Sergio Durigan Junior
2017-06-30 13:02                 ` Pedro Alves
2017-06-30 13:33                   ` Sergio Durigan Junior
2017-06-30 13:49                     ` Pedro Alves
2017-06-30 13:51                       ` Sergio Durigan Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760fdlo92.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guitton@adacore.com \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).