aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2011-03-23 10:08:16 +0000
committerMichael Brown <mcb30@ipxe.org>2011-03-23 10:08:16 +0000
commitb36882be34d13b585a61b58859d57f3c591dfb98 (patch)
treef443124500e6c4be68ee12040964ee607cd6bb9c
parentf0cd4abd0780606e04b007251e91621695ba259b (diff)
downloadipxe-b36882be34d13b585a61b58859d57f3c591dfb98.zip
ipxe-b36882be34d13b585a61b58859d57f3c591dfb98.tar.gz
ipxe-b36882be34d13b585a61b58859d57f3c591dfb98.tar.bz2
[settings] Fix setting expansion
Commit 5fbd020 ("[settings] Display canonical setting name in output of "show" command") introduced a regression causing all setting expansions (e.g. "${net0/mac}") to expand to an empty string. Fix by returning the formatted value length from fetchf_named_setting(), as expected by the caller. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/core/settings.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/settings.c b/src/core/settings.c
index acd093f..d498db6 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -1123,6 +1123,7 @@ int fetchf_named_setting ( const char *name,
struct setting setting;
struct settings *origin;
char tmp_name[ strlen ( name ) + 1 ];
+ int len;
int rc;
/* Parse setting name */
@@ -1131,16 +1132,16 @@ int fetchf_named_setting ( const char *name,
return rc;
/* Fetch setting */
- if ( ( rc = fetchf_setting ( settings, &setting, value_buf,
+ if ( ( len = fetchf_setting ( settings, &setting, value_buf,
value_len ) ) < 0 )
- return rc;
+ return len;
/* Construct setting name */
origin = fetch_setting_origin ( settings, &setting );
assert ( origin != NULL );
setting_name ( origin, &setting, name_buf, name_len );
- return 0;
+ return len;
}
/******************************************************************************