summaryrefslogtreecommitdiff
path: root/src/setup.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-07-05 15:06:28 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-07-05 15:10:25 -0700
commitbe48e352f08a7a6e5e96862865cff7946985dd32 (patch)
tree2200b732135a6cfcd47a2b9f81f2318895f7dd66 /src/setup.h
parentbbe45df29cbe2e7587a70f334283602f2d6f0bba (diff)
setup: return failed desc _path_ from setup_interactively()
Returning the failed desc was just a lazy half-assed thing that was sort of the best option in the simpler, pre-paths world. But now that everything has paths thanks to recursive settings, let's just return the path to the failed setting's desc. This conveniently gets rid of a UAF bug when setup returned the setting->desc as the failed desc, and main would print the desc *after* freeing all the settings in its final moments. But the best part is now more of the errors parsing settings should be accompanied by an illuminatingly relevant setting path. Previously you'd at best get a bare key from the desc, but often no failed desc was returned at all and you saw no guidance at all. But with the recent improvements to the setup error handling I think those cases should be few if not entirely eliminated.
Diffstat (limited to 'src/setup.h')
-rw-r--r--src/setup.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/setup.h b/src/setup.h
index 0862e45..484cc3e 100644
--- a/src/setup.h
+++ b/src/setup.h
@@ -4,6 +4,6 @@
#include "til_settings.h"
#include "til_setup.h"
-int setup_interactively(til_settings_t *settings, int (*setup_func)(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup), int defaults, til_setup_t **res_setup, const til_setting_desc_t **res_failed_desc);
+int setup_interactively(til_settings_t *settings, int (*setup_func)(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup), int defaults, til_setup_t **res_setup, const char **res_failed_desc_path);
#endif
© All Rights Reserved