david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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>
This commit is contained in:
Michael Brown 2011-03-23 10:08:16 +00:00
parent f0cd4abd07
commit b36882be34
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}
/******************************************************************************