Skip to content

Commit

Permalink
kconfig: fix bug in search results string: use strlen(gstr->s), not g…
Browse files Browse the repository at this point in the history
…str->len

The struct gstr has a capacity that may differ from the actual string length.

However, a string manipulation in the function search_conf made the assumption
that it is the same, which led to messing up some search results, especially
when the content of the gstr in use had not yet reached at least 63 chars.

Signed-off-by: Martin Walch <[email protected]>
Acked-by: Wang YanQing <[email protected]>
Acked-by: Benjamin Poirier <[email protected]>
Reviewed-by: "Yann E. MORIN" <[email protected]>
Signed-off-by: "Yann E. MORIN" <[email protected]>
  • Loading branch information
Martin Walch authored and yann-morin-1998 committed Oct 8, 2013
1 parent 3381960 commit 503c823
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/kconfig/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
for (j = 4; --i >= 0; j += 2) {
menu = submenu[i];
if (head && location && menu == location)
jump->offset = r->len - 1;
jump->offset = strlen(r->s);
str_printf(r, "%*c-> %s", j, ' ',
_(menu_get_prompt(menu)));
if (menu->sym) {
Expand Down

0 comments on commit 503c823

Please sign in to comment.