-const uschar *ss = *log_file_path ? log_file_path : US LOG_FILE_PATH;
-
-if (*ss)
- for (logging_mode = 0;
- s = string_nextinlist(&ss, &sep, log_buffer, LOG_BUFFER_SIZE); )
- {
- if (Ustrcmp(s, "syslog") == 0)
- logging_mode |= LOG_MODE_SYSLOG;
- else if (!(logging_mode & LOG_MODE_FILE)) /* no file yet */
- {
- /* If a non-empty path is given, use it */
-
- if (*s)
- file_path = string_copy(s);
-
- /* If handling the config option, and the element is empty, we want to use
- the first non-empty, non-syslog item in LOG_FILE_PATH, if there is one,
- since the value of log_file_path may have been set at runtime. If there is
- no such item, use the ultimate default in the spool directory. */
-
- else if (*log_file_path && LOG_FILE_PATH[0])
- {
- ss = US LOG_FILE_PATH;
- continue;
- }
-
- logging_mode |= LOG_MODE_FILE;
- }
- else
- if (multiple) *multiple = TRUE;
- }
- else
- logging_mode = LOG_MODE_FILE;
-
-/* Set up the ultimate default if necessary. */
-
-if (logging_mode & LOG_MODE_FILE && !*file_path)
- file_path = string_sprintf("%s/log/%%slog", spool_directory);
+uschar *t;
+const uschar *tt = US LOG_FILE_PATH;
+while ((t = string_nextinlist(&tt, &sep, log_buffer, LOG_BUFFER_SIZE)))
+ {
+ if (Ustrcmp(t, "syslog") == 0 || t[0] == 0) continue;
+ file_path = string_copy(t);
+ break;
+ }