aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-03-22 17:25:26 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-03-22 22:20:29 -0400
commit124b42671cab1c96d99d292cd76f91b3b2a49e13 (patch)
tree4fff67f99badc44e68f88e0f04f07e61686e8f90
parentdb94a90195ba47fcbd8d02f3ffc9ce48cce34f5f (diff)
downloadstasis-124b42671cab1c96d99d292cd76f91b3b2a49e13.tar.gz
Remove the user-facing "${VAR}" notation.
* runtime_* functions will continue to use this functionality in internally to support strings such "PATH=/example.bin:${PATH}"
-rw-r--r--src/deliverable.c24
1 files changed, 14 insertions, 10 deletions
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);
+ }
}
}