Skip to contentSkip to conversation

menuconfig fix crash due to infinite recursion

PATCH In review maks attems 2 participants 2 messages Sep 29, 2004 – Sep 30, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 menuconfig fix crash due to infinite recursion

gawk(1) tells that getline "returns 0 on end of file and -1 on an error." in current script for menuconfig if getline has an error,
it is still treated as true.

2.6 don't use that script anymore.
fix suggestion from Aharon Robbins <[email protected]> debian bts has 2 bugs open concerning that issue, this is the one containing belows fix:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=147469

[TM] tested.
menuconfig still works for me. ;)

scripts/Menuconfig +1 -1
@@ -714,7 +714,7 @@ BEGIN {
 
 function parser(ifile,menu) {
 
-	while (getline <ifile) {
+	while ((getline < ifile) > 0) {
 		if ($1 == "mainmenu_option") {
 			comment_is_option = "1"
 		}

--
maks
kernel janitor http://janitor.kernelnewbies.org/

#1 lore raw

gawk(1) tells that getline "returns 0 on end of file and -1 on an error." in current script for menuconfig if getline has an error,
it is still treated as true, fix _both_ of its invocations.

2.6 don't use that script anymore.
fix suggestion from Aharon Robbins <[email protected]> debian bts has 2 bugs open concerning that issue, this is the one containing belows fix:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=147469

[TM] tested.
menuconfig still works for me. ;)

scripts/Menuconfig +2 -2
@@ -714,7 +714,7 @@ BEGIN {
 
 function parser(ifile,menu) {
 
-	while (getline <ifile) {
+	while ((getline <ifile) > 0) {
 		if ($1 == "mainmenu_option") {
 			comment_is_option = "1"
 		}
@@ -761,7 +761,7 @@ BEGIN {
 
 function parser(ifile,menu) {
 
-	while (getline <ifile) {
+	while ((getline <ifile) > 0) {
 		if ($0 ~ /^#|$MAKE|mainmenu_name/) {
 			printf("") >>menu
 		}

--
maks
kernel janitor http://janitor.kernelnewbies.org/