All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: linux-kbuild@vger.kernel.org
Cc: Michal Marek <mmarek@suse.cz>, Martin Walch <walch.martin@web.de>,
	"Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: [PATCH 6/7] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len
Date: Wed, 30 Oct 2013 22:46:19 +0100	[thread overview]
Message-ID: <503c823048e81cc85c0e9d8c297cc70203e335e5.1383168460.git.yann.morin.1998@free.fr> (raw)
In-Reply-To: <cover.1383168460.git.yann.morin.1998@free.fr>

From: Martin Walch <walch.martin@web.de>

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 <walch.martin@web.de>
Acked-by: Wang YanQing <udknight@gmail.com>
Acked-by: Benjamin Poirier <bpoirier@suse.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 scripts/kconfig/menu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 9e69f19..db1512a 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -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) {
-- 
1.8.1.2


  parent reply	other threads:[~2013-10-30 21:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 21:46 [pull request] Pull request for branch yem/kconfig-for-next Yann E. MORIN
2013-10-30 21:46 ` [PATCH 1/7] Documentation/kbuild/kconfig.txt: 'make listnewconfig' replaces: yes "" | make oldconfig Yann E. MORIN
2013-10-30 21:46 ` [PATCH 2/7] kconfig: add short explanation to SYMBOL_WRITE Yann E. MORIN
2013-10-30 21:46 ` [PATCH 3/7] kconfig: fix trivial typos and update mconf documentation Yann E. MORIN
2013-10-30 21:46 ` [PATCH 4/7] kconfig: adjust warning message for conflicting types Yann E. MORIN
2013-10-30 21:46 ` [PATCH 5/7] kconfig: remove unused definition from scanner Yann E. MORIN
2013-10-30 21:46 ` Yann E. MORIN [this message]
2013-10-30 21:46 ` [PATCH 7/7] xconfig: Fix the filename for GUI settings Yann E. MORIN
2013-10-31 11:18 ` [pull request] Pull request for branch yem/kconfig-for-next Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=503c823048e81cc85c0e9d8c297cc70203e335e5.1383168460.git.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=walch.martin@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.