git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix bug in parse_color that prevented the user from changing the background colors.

From
Chris Larson <clarson@kergoth.com>
Date
Feb 5, 2008, 18:48 UTC
Message-ID
<b6ebd0a50802051048s3db55f6yab79e8982fd81b81@mail.gmail.com>
In-Reply-To
<b6ebd0a50802051045t4949df68u7e405ea618403a31@mail.gmail.com>
On Feb 5, 2008 11:39 AM, Timo Hirvonen <tihirvon@gmail.com> wrote:
Show 18 quoted lines
>
> Chris Larson <clarson@kergoth.com> wrote:
>
> > unable to convert the string in its entirety into an integer.
>
> > -    if (*name && !*end && i >= -1 && i <= 255)
> > +    if (*name && i >= -1 && i <= 255)
> >          return i;
> >      return -2;
> >  }
>
>
> My bug, sorry. I should have tested more.
>
> I think this new code accepts "7bold" (didn't test).  Maybe you should
> do something like this instead:
>
>        if (*name && (!*end || isspace(*end)) && i >= -1 && i <= 255)

Indeed, I should have tested more too :) Just starting to mess with the codebase, surprised at how clean it is (though I probably shouldn't be).

> Untested of course.  BTW, your patch is whitespace corrupted.
>

Unsurprising... sometimes I really hate gmail :| Anyone know if there's a way to post with gmail without hosing the patch, or should I switch to a non-web based solution?

Thanks,
-- 
Chris Larson - clarson at kergoth dot com
Dedicated Engineer - MontaVista - clarson at mvista dot com
Core Developer/Architect - TSLib, BitBake, OpenEmbedded, OpenZaurus
Previous: Timo HirvonenNext: Timo Hirvonen
Message 3 of 8 in “Fix bug in parse_color that prevented the user from changing the background colors.”
  1. Fix bug in parse_color that prevented the user from changing the background colors.Chris Larson, Feb 5, 2008
  2. Timo HirvonenFeb 5, 2008
  3. Chris LarsonFeb 5, 2008
  4. Timo HirvonenFeb 5, 2008
  5. Fix parsing numeric color valuesTimo Hirvonen, Feb 5, 2008
  6. Junio C HamanoFeb 6, 2008
  7. Fix parsing numeric color valuesTimo Hirvonen, Feb 6, 2008
  8. Add tests for diff/status color parserTimo Hirvonen, Feb 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.