Re: [Cgdb-devel] Bug in cgdb/src/highlight_groups.c
Brought to you by:
bobbybrasko,
crouchingturbo
From: Bob R. <bob...@co...> - 2007-03-21 14:27:42
|
On Wed, Mar 21, 2007 at 10:00:28AM -0400, Seth Moore wrote: > Hey cgdbers, > > There's a bug in the hl parsing in cgdb/src/highlight_groups.c: > 158 static int > 159 get_hl_group_kind_from_name (const char *name, enum hl_group_kind *kind) > 160 { > 161 int i; > 162 > 163 if (!name || !kind) > 164 return -1; > 165 > 166 for (i = 0; hl_group_names[i].name != NULL; ++i) > 167 if (strcasecmp (name, hl_group_names[i].name) == 0) > 168 { > > On line 166, the field name is compared with NULL, but it's actually a > string constant "NULL" in the array hl_group_names. It's a simple > fix: > > @@ -140,7 +140,7 @@ > {HLG_ENABLED_BREAKPOINT, "Breakpoint"}, > {HLG_DISABLED_BREAKPOINT, "DisabledBreakpoint"}, > {HLG_LOGO, "Logo"}, > - {HLG_LAST, "NULL"} > + {HLG_LAST, NULL} > }; > > I'm new to cgdb, but so far I'm liking it a lot. Much love for the > vim-style key bindings. Keep up the good work. Great! That will be incorporated into the next release, which should be soon. What a silly bug! Was CGDB crashing for you? How did you come across this bug? Thanks, Bob Rossi |