comparison m_option.c @ 34169:9b617726812c

Sanitize include behaviour. The normal func_param argument type will iterate over all previous values each time a new value is assigned. This leads e.g. to a complete mess and non-working recursion limiting when creating a config file that includes itself. Seem to also fix bug #1994.
author reimar
date Tue, 25 Oct 2011 20:18:35 +0000
parents ab178e06077e
children a05c274e1409
comparison
equal deleted inserted replaced
34168:55abe5125482 34169:9b617726812c
712 free_str_list 712 free_str_list
713 }; 713 };
714 714
715 715
716 /////////////////// Func based options 716 /////////////////// Func based options
717
718 static int parse_call_func(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
719 ((m_opt_func_param_t) opt->p)(opt,param);
720 }
721
722 // special variant, will not have a history/be able to
723 // be used as per-file option etc.
724 const m_option_type_t m_option_type_func_param_immediate = {
725 "Func param once",
726 "",
727 0,
728 M_OPT_TYPE_INDIRECT,
729 parse_call_func,
730 NULL,
731 NULL, // Nothing to do on save
732 NULL,
733 NULL,
734 NULL
735 };
717 736
718 // A chained list to save the various calls for func_param and func_full 737 // A chained list to save the various calls for func_param and func_full
719 typedef struct m_func_save m_func_save_t; 738 typedef struct m_func_save m_func_save_t;
720 struct m_func_save { 739 struct m_func_save {
721 m_func_save_t* next; 740 m_func_save_t* next;