[Cgdb-devel] Bug in cgdb/src/highlight_groups.c
Brought to you by:
bobbybrasko,
crouchingturbo
|
From: Seth M. <set...@gm...> - 2007-03-21 14:00:41
|
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.
Thanks
-Seth
|