From 2702682fae550f3b791057a1d31610f83f7fec7c Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Wed, 8 Jul 2026 18:56:50 +0200 Subject: [PATCH] fixed displayed value --- profile.d/conf.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/profile.d/conf.sh b/profile.d/conf.sh index bf4fad1..2e209a9 100755 --- a/profile.d/conf.sh +++ b/profile.d/conf.sh @@ -285,8 +285,9 @@ conf_dump() # Commented-out key=value — shown only with show_all. # The value displayed is the live environment value (what load_conf - # actually exported), not the commented-out text which may be an - # example or stale documentation. Each key is shown at most once. + # actually exported); when the key is not set in the environment we + # fall back to the value written in the comment, i.e. the documented + # default. Each key is shown at most once. if (show_all && $0 ~ /^[[:space:]]*#[[:space:]]*[A-Za-z_][A-Za-z0-9_]*[[:space:]]*=/) { line = $0; sub(/^[[:space:]]*#[[:space:]]*/, "", line) key = line; sub(/[[:space:]]*=.*$/, "", key); sub(/^[[:space:]]*/, "", key) @@ -294,6 +295,7 @@ conf_dump() seen[current_sec ":" key] = 1 if (key_filter != "" && index(key, key_filter) == 0) next val = ENVIRON[key] + if (val == "") { val = line; sub(/^[^=]*=[[:space:]]*/, "", val) } if (!hdr_printed) { if (found) print "" print c_sec "[" current_sec "]" c_rst