string. Previously it was possible to cause undefined behaviour in a
library routine (usually a crash). Found by "zerons".
string. Previously it was possible to cause undefined behaviour in a
library routine (usually a crash). Found by "zerons".
+JH/12 Bug 2384: fix "-bP smtp_receive_timeout". Previously it returned no
+ output.
+
static uschar * syslog_facility_str;
static uschar * syslog_facility_str;
-static void fn_smtp_receive_timeout(const uschar *, const uschar *);
+static void fn_smtp_receive_timeout(const uschar *, const uschar *, unsigned);
/*************************************************
* Main configuration options *
/*************************************************
* Main configuration options *
-static void fn_smtp_receive_timeout(const uschar * name, const uschar * str) {/*Dummy*/}
+static void
+fn_smtp_receive_timeout(const uschar * name, const uschar * str, unsigned flags) {/*Dummy*/}
static int syslog_list_size = sizeof(syslog_list)/sizeof(syslog_fac_item);
static int syslog_list_size = sizeof(syslog_list)/sizeof(syslog_fac_item);
+#define opt_fn_print BIT(0)
+#define opt_fn_print_label BIT(1)
/*************************************************
/*************************************************
* Custom-handler options *
*************************************************/
static void
* Custom-handler options *
*************************************************/
static void
-fn_smtp_receive_timeout(const uschar * name, const uschar * str)
+fn_smtp_receive_timeout(const uschar * name, const uschar * str, unsigned flags)
+if (flags & opt_fn_print)
+ {
+ if (flags & opt_fn_print_label) printf("%s = ", name);
+ printf("%s\n", smtp_receive_timeout_s
+ ? string_printing2(smtp_receive_timeout_s, FALSE)
+ : readconf_printtime(smtp_receive_timeout));
+ }
+else if (*str == '$')
smtp_receive_timeout_s = string_copy(str);
else
{
smtp_receive_timeout_s = string_copy(str);
else
{
case opt_func:
{
void (*fn)() = ol->value;
case opt_func:
{
void (*fn)() = ol->value;
case opt_bool_set:
printf("%s%s\n", (*((BOOL *)value))? "" : "no_", name);
break;
case opt_bool_set:
printf("%s%s\n", (*((BOOL *)value))? "" : "no_", name);
break;
+
+ case opt_func:
+ {
+ void (*fn)() = ol->value;
+ fn(name, NULL, no_labels ? opt_fn_print : opt_fn_print|opt_fn_print_label);
+ break;
+ }