From c9579598c5a1b49f7fe8e353623175bf8f3cc236 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 8 Aug 2024 12:45:05 -0400 Subject: Return of the INI refactor (#20) * Continuation of #19 * Fixes always_update_base_environment override bug added by PR #19 * Finish type hinting implementation * ini_getval_* functions now able to affect rendering mode using INI_READ_RAW and INI_READ_RENDER * Created pointers to deeply nested structures to increase readability * Output from ini_write() is more consistent, with fewer errant spaces and line feeds * Fixes accidental regression in #19. INIVAL_TYPE_STR_ARRAY never produced an array of pointers to char. This needs to be corrected in the future. i.e. It has always generated a new-line delimited string, not a StrList, or array. * Fix strlist_append_tokenize * original pointer is no longer modified * token strings are stripped of leading space before appending to the list * Use defines instead of magic numbers * delivery_init: add render_mode argument * test_conda: Add render mode * test_ini: Add render mode * Only add conda packages and wheels to the image * docker images are saved to the packages directory and will be consumed by the image if present. * Render template variables after bootstrapping the delivery --- src/strlist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/strlist.c') diff --git a/src/strlist.c b/src/strlist.c index bdacb5a..d1bb926 100644 --- a/src/strlist.c +++ b/src/strlist.c @@ -174,13 +174,16 @@ void strlist_append_strlist(struct StrList *pStrList1, struct StrList *pStrList2 return; } - token = split(str, delim, 0); + char *tmp = strdup(str); + token = split(tmp, delim, 0); if (token) { for (size_t i = 0; token[i] != NULL; i++) { + lstrip(token[i]); strlist_append(&pStrList, token[i]); } GENERIC_ARRAY_FREE(token); } + guard_free(tmp); } /** -- cgit