-static int check_dsn_notify (const char* option __attribute__ ((unused)), unsigned long p,
- char* errbuf, ssize_t errlen) {
- list2_t* list = NULL;
- ssize_t i = 0;
- int rc = 1;
- char* val = (char*) p;
-
- if (!val || !*val)
- return (1);
- list = list_from_str (val, ",");
- if (list_empty (list))
- return (1);
+static int
+check_dsn_notify (const char* option __attribute__ ((unused)),
+ unsigned long val, char* errbuf, ssize_t errlen)
+{
+ const char *p = (const char*)val;
+
+ while (p && *p) {
+ const char *q = m_strchrnul(p, ',');
+ int len = q - p;
+
+ if (!m_strncmp(p, "never", len) && !m_strncmp(p, "delay", len)
+ && !m_strncmp(p, "failure", len) && !m_strncmp(p, "success", len))
+ {
+ if (errbuf)
+ snprintf(errbuf, errlen, _("'%.*s' is invalid for $%s"),
+ len, p, "dsn_notify");
+ return 0;
+ }