On Wed, Apr 08, 2015 at 05:16:08PM -0500, Segher Boessenkool wrote:
> On Wed, Apr 08, 2015 at 05:12:07PM -0500, Segher Boessenkool wrote:
> > On Wed, Apr 08, 2015 at 11:00:59PM +0200, Jakub Jelinek wrote:
> > > +    case MATCH_CODE:
> > > +      if (*XSTR (exp, 1) == '\0')
> > > + {
> > > +   const char *code, *codes = XSTR (exp, 0);
> > > +   int ret = 0;
> > > +   while ((code = scan_comma_elt (&codes)) != 0)
> > > +     if (strncmp (code, "reg", 3) == 0
> > > +         && (code[3] == ',' || code[3] == '\0' || code[3] == ' '))
> > 
> > This doesn't allow other whitespace.  Maybe it's cleaner written as e.g.
> > 
> >     && codes - code == 3
> 
> ... and that doesn't handle trailing whitespace.  Ugh.

Yeah.  Guess I should use
        && (code[3] == ',' || code[3] == '\0' || ISSPACE (code[3]))
instead then.

        Jakub

Reply via email to