<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/scripts/kconfig/nconf.gui.c, branch v4.20</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.20</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-02-10T02:26:04Z</updated>
<entry>
<title>kconfig: add xrealloc() helper</title>
<updated>2018-02-10T02:26:04Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-02-08T16:19:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d717f24d8c68081caae2374cf5ea6c4e62c490fc'/>
<id>urn:sha1:d717f24d8c68081caae2374cf5ea6c4e62c490fc</id>
<content type='text'>
We already have xmalloc(), xcalloc().  Add xrealloc() as well
to save tedious error handling.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
</entry>
<entry>
<title>kconfig: fix sparse warnings in nconfig</title>
<updated>2017-06-22T21:00:52Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2017-05-23T01:44:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ad8181060788c80c0ad75b583f24c22fa962a7a6'/>
<id>urn:sha1:ad8181060788c80c0ad75b583f24c22fa962a7a6</id>
<content type='text'>
Fix sparse warnings in scripts/kconfig/nconf* ('make nconfig'):

../scripts/kconfig/nconf.c:1071:32: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:1238:30: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:511:51: warning: Using plain integer as NULL pointer
../scripts/kconfig/nconf.c:1460:6: warning: symbol 'setup_windows' was not declared. Should it be static?
../scripts/kconfig/nconf.c:274:12: warning: symbol 'current_instructions' was not declared. Should it be static?
../scripts/kconfig/nconf.c:308:22: warning: symbol 'function_keys' was not declared. Should it be static?
../scripts/kconfig/nconf.gui.c:132:17: warning: non-ANSI function declaration of function 'set_colors'
../scripts/kconfig/nconf.gui.c:195:24: warning: Using plain integer as NULL pointer

nconf.gui.o before/after files are the same.
nconf.o before/after files are the same until the 'static' function
declarations are added.

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
</entry>
<entry>
<title>kconfig/nconf: Fix hang when editing symbol with a long prompt</title>
<updated>2016-12-11T11:26:42Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben.hutchings@codethink.co.uk</email>
</author>
<published>2016-11-24T22:10:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=79e51b5c2deea542b3bb8c66e0d502230b017dde'/>
<id>urn:sha1:79e51b5c2deea542b3bb8c66e0d502230b017dde</id>
<content type='text'>
Currently it is impossible to edit the value of a config symbol with a
prompt longer than (terminal width - 2) characters.  dialog_inputbox()
calculates a negative x-offset for the input window and newwin() fails
as this is invalid.  It also doesn't check for this failure, so it
busy-loops calling wgetch(NULL) which immediately returns -1.

The additions in the offset calculations also don't match the intended
size of the window.

Limit the window size and calculate the offset similarly to
show_scroll_win().

Cc: stable &lt;stable@vger.kernel.org&gt;
Fixes: 692d97c380c6 ("kconfig: new configuration interface (nconfig)")
Signed-off-by: Ben Hutchings &lt;ben.hutchings@codethink.co.uk&gt;
</content>
</entry>
<entry>
<title>nconf: use function calls instead of ncurses' variables LINES and COLS</title>
<updated>2013-06-18T21:58:58Z</updated>
<author>
<name>Dirk Gouders</name>
<email>dirk@gouders.net</email>
</author>
<published>2013-05-13T09:23:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e0b42605e685a0833303e1d4dde277c99d9e17b5'/>
<id>urn:sha1:e0b42605e685a0833303e1d4dde277c99d9e17b5</id>
<content type='text'>
According to the documentation [1], LINES and COLS are initialized by
initscr(); it does not say anything about the behavior when windows are
resized.

Do not rely on the current implementation of ncurses that updates
these variables on resize, but use the propper function calls or macros
to get window dimensions.

The use of the variables in main() was OK, but for the sake of
consistency it was modified to use the macro getmaxyx().

[1] ncurses(3X)

Signed-off-by: Dirk Gouders &lt;dirk@gouders.net&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
[yann.morin.1998@free.fr: declare 'lines' and 'columns' on a single line]
Signed-off-by: Yann E. MORIN &lt;yann.morin.1998@free.fr&gt;
</content>
</entry>
<entry>
<title>nconf: function keys line, change background color for better readability</title>
<updated>2013-01-24T10:43:44Z</updated>
<author>
<name>Roland Eggner</name>
<email>edvx1@systemanalysen.net</email>
</author>
<published>2012-12-29T22:33:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c5ffa130f3644b51e588a2a6770648b6ea936969'/>
<id>urn:sha1:c5ffa130f3644b51e588a2a6770648b6ea936969</id>
<content type='text'>
•  In function keys line descriptions black on darkblue are almost
   impossible to read.  Change colors to black on brown.

Signed-off-by: Roland Eggner &lt;edvx1@systemanalysen.net&gt;
Tested-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
</content>
</entry>
<entry>
<title>nconf: add u, d command keys in scroll windows</title>
<updated>2012-07-26T10:20:46Z</updated>
<author>
<name>Benjamin Poirier</name>
<email>bpoirier@suse.de</email>
</author>
<published>2012-07-24T20:12:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d68e818bc4d5c962093ced51c4d8341fc6aea30d'/>
<id>urn:sha1:d68e818bc4d5c962093ced51c4d8341fc6aea30d</id>
<content type='text'>
They function just like they do in less(1).
Also correct some discrepancy between the help text and the code wrt
function keys.

Signed-off-by: Benjamin Poirier &lt;bpoirier@suse.de&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>scripts/kconfig/nconf: add KEY_HOME / KEY_END for dialog_inputbox</title>
<updated>2011-09-09T12:40:08Z</updated>
<author>
<name>Cheng Renquan</name>
<email>crquan@gmail.com</email>
</author>
<published>2011-09-01T17:52:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=93072c3ecafcf188390750cc755185f3150736b9'/>
<id>urn:sha1:93072c3ecafcf188390750cc755185f3150736b9</id>
<content type='text'>
to make it easier to locate begin/end when editing long strings;

Signed-off-by: Cheng Renquan &lt;crquan@gmail.com&gt;
Acked By: Nir Tzachar &lt;nir.tzachar@gmail.com&gt;
</content>
</entry>
<entry>
<title>scripts/kconfig/nconf: fix editing long strings</title>
<updated>2011-09-09T12:40:08Z</updated>
<author>
<name>Cheng Renquan</name>
<email>crquan@gmail.com</email>
</author>
<published>2011-09-01T17:52:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e631a57a19e103c3bb59495b236634ec62e2a850'/>
<id>urn:sha1:e631a57a19e103c3bb59495b236634ec62e2a850</id>
<content type='text'>
The original dialog_inputbox doesn't work with longer than prompt_width
strings, here fixed it in this way:
1) add variable cursor_form_win to record cursor of form_win,
   keep its value always between [0, prompt_width-1];
   reuse the original cursor_position as cursor of the string result,
   use (cursor_position-cursor_form_win) as begin offset to show part of
   the string in form_win;

Signed-off-by: Cheng Renquan &lt;crquan@gmail.com&gt;
Cc: Arnaud Lacombe &lt;lacombar@gmail.com&gt;
Cc: Nir Tzachar &lt;nir.tzachar@gmail.com&gt;
</content>
</entry>
<entry>
<title>scripts/kconfig/nconf: dynamically alloc dialog_input_result</title>
<updated>2011-09-09T12:40:08Z</updated>
<author>
<name>Cheng Renquan</name>
<email>crquan@gmail.com</email>
</author>
<published>2011-09-01T17:52:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5ea9f64ffc073bf2882f6aa83b0dad3609b1e67a'/>
<id>urn:sha1:5ea9f64ffc073bf2882f6aa83b0dad3609b1e67a</id>
<content type='text'>
To support unlimited length string config items;

No check for realloc return value keeps code simple, and to be
consistent with other existing unchecked malloc in kconfig.

Signed-off-by: Cheng Renquan &lt;crquan@gmail.com&gt;
Signed-off-by: Arnaud Lacombe &lt;lacombar@gmail.com&gt;
</content>
</entry>
<entry>
<title>scripts/kconfig/nconf: fix memmove's length arg</title>
<updated>2011-09-09T12:40:08Z</updated>
<author>
<name>Cheng Renquan</name>
<email>crquan@gmail.com</email>
</author>
<published>2011-09-01T17:52:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cd58a90fa6ff2ec86bcc9e399acfd6dcc97268b3'/>
<id>urn:sha1:cd58a90fa6ff2ec86bcc9e399acfd6dcc97268b3</id>
<content type='text'>
In case KEY_BACKSPACE / KEY_DC to delete a char, it memmove only
(len-cursor_position+1) bytes;
the default case is to insert a char, it should also memmove exactly
(len-cursor_position+1) bytes;

the original use of (len+1) is wrong and may access following memory
that doesn't belong to result, may cause SegFault in theory;

	case KEY_BACKSPACE:
		if (cursor_position &gt; 0) {
			memmove(&amp;result[cursor_position-1],
					&amp;result[cursor_position],
					len-cursor_position+1);
			cursor_position--;
		}
		break;
	case KEY_DC:
		if (cursor_position &gt;= 0 &amp;&amp; cursor_position &lt; len) {
			memmove(&amp;result[cursor_position],
					&amp;result[cursor_position+1],
					len-cursor_position+1);
		}
		break;
	default:
		if ((isgraph(res) || isspace(res)) &amp;&amp;
				len-2 &lt; result_len) {
			/* insert the char at the proper position */
			memmove(&amp;result[cursor_position+1],
					&amp;result[cursor_position],
					len-cursor_position+1);
			result[cursor_position] = res;
			cursor_position++;
		}

Signed-off-by: Cheng Renquan &lt;crquan@gmail.com&gt;
Acked-by: Nir Tzachar &lt;nir.tzachar@gmail.com&gt;
</content>
</entry>
</feed>
