From 124b42671cab1c96d99d292cd76f91b3b2a49e13 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 22 Mar 2024 17:25:26 -0400 Subject: Remove the user-facing "${VAR}" notation. * runtime_* functions will continue to use this functionality in internally to support strings such "PATH=/example.bin:${PATH}" --- src/deliverable.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/deliverable.c b/src/deliverable.c index 8201de2..c424033 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -21,10 +21,13 @@ static void conv_int(int *x, union INIVal val) { } static void conv_str(char **x, union INIVal val) { - char *rtevnop = runtime_expand_var(NULL, val.as_char_p); - char *tplop = tpl_render(rtevnop); - if (tplop) { - *x = tplop; + if (val.as_char_p) { + char *tplop = tpl_render(val.as_char_p); + if (tplop) { + *x = tplop; + } else { + *x = NULL; + } } else { *x = NULL; } @@ -35,14 +38,15 @@ static void conv_str_noexpand(char **x, union INIVal val) { } static void conv_strlist(struct StrList **x, char *tok, union INIVal val) { - char *rtevnop = runtime_expand_var(NULL, val.as_char_p); - char *tplop = tpl_render(rtevnop); if (!(*x)) (*x) = strlist_init(); - if (tplop) { - strip(tplop); - strlist_append_tokenize((*x), tplop, tok); - guard_free(tplop); + if (val.as_char_p) { + char *tplop = tpl_render(val.as_char_p); + if (tplop) { + strip(tplop); + strlist_append_tokenize((*x), tplop, tok); + guard_free(tplop); + } } } -- cgit