This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR cli/21688: Fix multi-line/inline command differentiation


On 06/30/2017 12:24 PM, Sergio Durigan Junior wrote:

> Hm, no, it doesn't.  I guess that the best approach would be to make
> sure that lookup_cmd_1 advances the **text pointer past all the
> whitespace chars after it matches a command, and then we could use
> Simon's idea and check for *cmd_name != '\0'.

I don't see the point of touching lookup_cmd_1, and then
handling fallout of that.

Simply do this after the lookup_cmd_1 call:

  lookup_cmd = skip_spaces_const (cmd_name);
  bool inline_cmd = *cmd_name != '\0';

and then you can do:

      else if (command_name_equals (cmd, "python") && !inline_cmd)

?

> 
> I'll prepare a patch here and do some testings.
> 


-- 
Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]