mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Romain Lievin <rlievin@free.fr>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: kconfig (qconf): bug ?
Date: Sat, 9 Nov 2002 21:04:35 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.44.0211092054360.2113-100000@serv> (raw)
In-Reply-To: <20021109134444.GB9480@free.fr>

Hi,

On Sat, 9 Nov 2002, Romain Lievin wrote:

> BTW, I noticed something weird with Qconf. I don't know whether it's a
> bug or a mis-behaviour...
> 
> Once you have a .config file in /usr/src/linux and if you attempt to load
> another config file, Qconf will not load my settings.
> If you does not have the .config file yet (freshen install) and I attempt to
> load my config file,  Qconf will load it fine...

The file was loaded, but the values were not immediately visible. The 
symbol value is only calculated on demand and the flag wasn't cleared 
(you had to change one value to see the update). The patch below fixes and 
also forces a redisplay in qconf.
The patch also moves conf_filename to it's only user (mconf).

bye, Roman

diff -ur linux-2.5/scripts/kconfig/confdata.c linux-lkc/scripts/kconfig/confdata.c
--- linux-2.5/scripts/kconfig/confdata.c	2002-11-09 20:43:01.000000000 +0100
+++ linux-lkc/scripts/kconfig/confdata.c	2002-11-09 20:44:52.000000000 +0100
@@ -4,7 +4,6 @@
  */
 
 #include <ctype.h>
-#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -14,7 +13,6 @@
 #include "lkc.h"
 
 const char conf_def_filename[] = ".config";
-char conf_filename[PATH_MAX+1];
 
 const char conf_defname[] = "arch/$ARCH/defconfig";
 
@@ -71,8 +69,6 @@
 
 	if (name) {
 		in = fopen(name, "r");
-		if (in)
-			strcpy(conf_filename, name);
 	} else {
 		const char **names = conf_confnames;
 		while ((name = *names++)) {
@@ -91,21 +87,21 @@
 		return 1;
 
 	for_all_symbols(i, sym) {
-		sym->flags |= SYMBOL_NEW;
+		sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED;
+		sym->flags &= ~SYMBOL_VALID;
 		switch (sym->type) {
 		case S_INT:
 		case S_HEX:
 		case S_STRING:
-			if (S_VAL(sym->def)) {
+			if (S_VAL(sym->def))
 				free(S_VAL(sym->def));
-				S_VAL(sym->def) = NULL;
-			}
 		default:
-			;
+			S_VAL(sym->def) = NULL;
+			S_TRI(sym->def) = no;
 		}
 	}
 
-	while (fgets(line, 128, in)) {
+	while (fgets(line, sizeof(line), in)) {
 		lineno++;
 		switch (line[0]) {
 		case '#':
@@ -357,7 +359,6 @@
 	rename(name, oldname);
 	if (rename(".tmpconfig", name))
 		return 1;
-	strcpy(conf_filename, name);
 
 	sym_change_count = 0;
 
diff -ur linux-2.5/scripts/kconfig/mconf.c linux-lkc/scripts/kconfig/mconf.c
--- linux-2.5/scripts/kconfig/mconf.c	2002-11-09 20:43:01.000000000 +0100
+++ linux-lkc/scripts/kconfig/mconf.c	2002-11-09 20:44:53.000000000 +0100
@@ -11,6 +11,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <limits.h>
 #include <signal.h>
 #include <stdarg.h>
 #include <stdlib.h>
@@ -82,6 +83,7 @@
 
 static char buf[4096], *bufptr = buf;
 static char input_buf[4096];
+static char filename[PATH_MAX+1] = ".config";
 static char *args[1024], **argptr = args;
 static int indent = 0;
 static struct termios ios_org;
@@ -661,7 +663,7 @@
 		cprint(load_config_text);
 		cprint("11");
 		cprint("55");
-		cprint("%s", conf_filename);
+		cprint("%s", filename);
 		stat = exec_conf();
 		switch(stat) {
 		case 0:
@@ -690,7 +692,7 @@
 		cprint(save_config_text);
 		cprint("11");
 		cprint("55");
-		cprint("%s", conf_filename);
+		cprint("%s", filename);
 		stat = exec_conf();
 		switch(stat) {
 		case 0:
diff -ur linux-2.5/scripts/kconfig/qconf.cc linux-lkc/scripts/kconfig/qconf.cc
--- linux-2.5/scripts/kconfig/qconf.cc	2002-11-09 20:43:01.000000000 +0100
+++ linux-lkc/scripts/kconfig/qconf.cc	2002-11-09 20:44:53.000000000 +0100
@@ -890,6 +890,8 @@
 		return;
 	if (conf_read(s.latin1()))
 		QMessageBox::information(this, "qconf", "Unable to load configuration!");
+	configList->updateListAll();
+	menuList->updateListAll();
 }
 
 void ConfigView::saveConfig(void)


      reply	other threads:[~2002-11-09 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-09 13:44 Romain Lievin
2002-11-09 20:04 ` Roman Zippel [this message]

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=Pine.LNX.4.44.0211092054360.2113-100000@serv \
    --to=zippel@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlievin@free.fr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®