diff mbox

[2/2] kconfig/nconf: prevent segfault on empty menu

Message ID 4E1CABBD.60901@udo.edu (mailing list archive)
State New, archived
Headers show

Commit Message

Andrej Gelenberg July 12, 2011, 8:17 p.m. UTC
Hi,

here is one more patch, which make empty title instead of "(null)".

Regards,
Andrej Gelenberg

On 07/11/2011 11:50 AM, Nir Tzachar wrote:
> On Mon, Jul 11, 2011 at 11:51 AM, Andrej Gelenberg
> <andrej.gelenberg@udo.edu> wrote:
>> Hello,
>>
>> it show already "There is no help available for this option." message on
>> F2. Only caption could be better as just "(null)". Besides ignore the
>> key is much better as segfault.
> 
> I agree. Then just add a proper caption and thats it.
> 
> Cheers.
> 
>> Regards
>> Andrej Gelenberg
From e5fa0e9a705c2e2092ba9c2879e85f8bef12f7f8 Mon Sep 17 00:00:00 2001
From: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Date: Tue, 12 Jul 2011 18:36:50 +0200
Subject: [PATCH] nconfig: menu_get_prompt() return "", if no promt

Help message box has "" as titled instead of "(null)" on empty menu in
nconf.

Signed-off-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
---
 scripts/kconfig/menu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Arnaud Lacombe July 12, 2011, 8:49 p.m. UTC | #1
Hi,

On Tue, Jul 12, 2011 at 4:17 PM, Andrej Gelenberg
<andrej.gelenberg@udo.edu> wrote:
> Hi,
>
> here is one more patch, which make empty title instead of "(null)".
>
No. You are breaking front-ends which either properly use the API and
make use menu_has_prompt() before getting the prompt with
menu_get_prompt(), or test for NULL pointer and act accordingly. Btw,
by doing this, you potentially breaking nconf too, and there is rarely
any need to modify the back-end to fix display issue in the front-end.

 - Arnaud

ps: could you please send inlined patched, that a real pain to review. thanks.

> Regards,
> Andrej Gelenberg
>
> On 07/11/2011 11:50 AM, Nir Tzachar wrote:
>> On Mon, Jul 11, 2011 at 11:51 AM, Andrej Gelenberg
>> <andrej.gelenberg@udo.edu> wrote:
>>> Hello,
>>>
>>> it show already "There is no help available for this option." message on
>>> F2. Only caption could be better as just "(null)". Besides ignore the
>>> key is much better as segfault.
>>
>> I agree. Then just add a proper caption and thats it.
>>
>> Cheers.
>>
>>> Regards
>>> Andrej Gelenberg
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 6a09cc4..0783d8e 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -476,7 +476,7 @@  const char *menu_get_prompt(struct menu *menu)
 		else if (menu->sym)
 			return menu->sym->name;
 	}
-	return NULL;
+	return "";
 }
 
 struct menu *menu_get_root_menu(struct menu *menu)