aboutsummaryrefslogtreecommitdiff
path: root/src/ini.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-08-07 11:03:10 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-08-07 11:03:10 -0400
commit09906cbbad8a1fe1ad442110dbeabff63540d656 (patch)
tree4886a76684148027e2233464c2039451d432c10f /src/ini.c
parent190b1fcddf3db8257722dbb7fd0f7e5c74fc7597 (diff)
downloadstasis-09906cbbad8a1fe1ad442110dbeabff63540d656.tar.gz
ini_getval: expand template variables immediately before processing the output
* Strip leading space to avoid issues with string comparisons against the result
Diffstat (limited to 'src/ini.c')
-rw-r--r--src/ini.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ini.c b/src/ini.c
index efc94e5..37d80fe 100644
--- a/src/ini.c
+++ b/src/ini.c
@@ -122,6 +122,14 @@ int ini_getval(struct INIFILE *ini, char *section_name, char *key, int type, uni
result->as_char_p = NULL;
return -1;
}
+
+ char *render = tpl_render(data->value);
+ if (render) {
+ guard_free(data->value);
+ data->value = render;
+ }
+ lstrip(data->value);
+
switch (type) {
case INIVAL_TYPE_CHAR:
result->as_char = (char) strtol(data->value, NULL, 10);