From da60fbbcb637b37b1d77a41886ae4e275422ca96 Mon Sep 17 00:00:00 2001
From: "Vadim Bendebury (вб)" <vbendeb@google.com>
Date: Sun, 20 Dec 2009 00:29:49 -0800
Subject: menuconfig: wrap long help lines

Help text for certain config options is very extensive (the text
includes the names of all  other options the option in question depends
on). Long lines are not wrapped, making it impossible to see the list
without scrolling horizontally.

This patch adds some logic which wraps help screen lines at word
boundaries to prevent truncating.

Tested by running

  ARCH=powerpc make menuconfig O=/tmp/build

which shows that the long lines are now wrapped, and

 ARCH=powerpc make xconfig O=/tmp/build

to demonstrate that it still compiles and operates as expected.

Signed-off-by: Vadim Bendebury <vbendeb@google.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 scripts/kconfig/util.c | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'scripts/kconfig/util.c')

diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index b6b2a46af14c..81c100d953ef 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -78,6 +78,7 @@ struct gstr str_new(void)
 	struct gstr gs;
 	gs.s = malloc(sizeof(char) * 64);
 	gs.len = 64;
+	gs.max_width = 0;
 	strcpy(gs.s, "\0");
 	return gs;
 }
@@ -88,6 +89,7 @@ struct gstr str_assign(const char *s)
 	struct gstr gs;
 	gs.s = strdup(s);
 	gs.len = strlen(s) + 1;
+	gs.max_width = 0;
 	return gs;
 }
 
-- 
cgit