aboutsummaryrefslogtreecommitdiffstats
path: root/chapter10/kernel/kernel-config.py
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-12-06 17:29:45 +0800
committerXi Ruoyao <xry111@xry111.site>2023-12-06 17:29:45 +0800
commit00de2694ce852e9b042eaa3225e0c079978e048f (patch)
tree5aff230d8826aa7d5b5e0ff258b35da56df0f858 /chapter10/kernel/kernel-config.py
parent73d91ac621a4e59f71ff6664c68c935317f9ce42 (diff)
parent7cce808a46c5a1df0de2c52827b89b63834436fe (diff)
Merge remote-tracking branch 'origin/trunk' into xry111/arm64
Diffstat (limited to 'chapter10/kernel/kernel-config.py')
-rwxr-xr-xchapter10/kernel/kernel-config.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/chapter10/kernel/kernel-config.py b/chapter10/kernel/kernel-config.py
index 24f825f72..349372945 100755
--- a/chapter10/kernel/kernel-config.py
+++ b/chapter10/kernel/kernel-config.py
@@ -185,6 +185,10 @@ def load_kconfig(file):
if_stack += [top]
elif line.startswith('endif'):
if_stack = if_stack[:-1]
+
+ if config_buf:
+ r += [parse_config(config_buf)]
+
return r
known_config = {}
@@ -247,6 +251,7 @@ sep = known_config.get('separate_toplevel_menu')
for i0, val, i1, title, arrow, key, menu, comment in r:
rem = max_line
+ is_choice = (val == '(X)')
if val:
val += (max_val_len[menu] - len(val)) * ' '
@@ -259,7 +264,9 @@ for i0, val, i1, title, arrow, key, menu, comment in r:
if len(title) > rem:
title = title[:rem - 3] + '...'
- b = title.lstrip('YyMmNnHh')
+ b = title
+ if not is_choice:
+ b = b.lstrip('YyMmNnHh.' + "".join(map(str, range(10))))
a = title[:len(title) - len(b)]
b0 = "<emphasis role='blue'>" + escape(b[0]) + "</emphasis>"
line += escape(a) + b0 + escape(b[1:]) + escape(arrow)