Skip to content

Commit ee5b93c

Browse files
committed
Fix spurious save prompt when no changes are made
When running menuconfig without an existing .config file, the save dialog was incorrectly shown even when the user made no changes. The issue was in _load_config() which returned True when .config was missing, causing _conf_changed to be initialized to True. This meant any exit would trigger the save prompt.
1 parent 0cab004 commit ee5b93c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

menuconfig.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -810,13 +810,13 @@ def menuconfig(kconf):
810810
def _load_config():
811811
# Loads any existing .config file. See the Kconfig.load_config() docstring.
812812
#
813-
# Returns True if .config is missing or outdated. We always prompt for
814-
# saving the configuration in that case.
813+
# Returns True if .config exists and is outdated. We prompt for saving the
814+
# configuration only if there are actual changes.
815815

816816
print(_kconf.load_config())
817817
if not os.path.exists(_conf_filename):
818-
# No .config
819-
return True
818+
# No .config - no changes yet
819+
return False
820820

821821
return _needs_save()
822822

0 commit comments

Comments
 (0)