Re: [PATCH/committed] sim: rl78: clean up various warnings

Tom Tromey
2021-05-05T17:30:45Z

>>>>> "Mike" == Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> writes:

Mike> Fix a logic error when processing commands where p was reassigned
Mike> to cmd and then has its leading whitespace scanned a 2nd time.
Mike> Handle short reads with fread().

Mike> - /* Find the extent of the command word. */
Mike> - for (p = cmd; *p; p++)
Mike> - if (isspace (*p))
Mike> - break;
Mike> -

I'm not sure it makes sense to completely delete this.
Perhaps instead just removing 'p = cmd' is correct?

It looks to me that this code is trying to parse a command name followed
by arguments. Like, ideally, "monitor trace on" should set cmd="trace"
and args="on", but with the patch I don't think this will happen.

Tom