Commit b54dd743 b54dd7430263789adc872f7568cde84cf14f66d4 by Sergey Poznyakoff

Bugfix (complements 6bd92d3c).

* libmu_sieve/util.c (mu_sieve_error, mu_sieve_debug)
(mu_sieve_log_action): Format location only if locus.mu_file
is not NULL.
1 parent c1421c3a
......@@ -209,8 +209,10 @@ mu_sieve_error (mu_sieve_machine_t mach, const char *fmt, ...)
va_list ap;
va_start (ap, fmt);
mu_stream_printf (mach->errstream, "\033s<%d>\033O<%d>\033f<%u>%s\033l<%u>",
MU_LOG_ERROR, MU_LOGMODE_LOCUS,
mu_stream_printf (mach->errstream, "\033s<%d>", MU_LOG_ERROR);
if (mach->locus.mu_file)
mu_stream_printf (mach->errstream, "\033O<%d>\033f<%u>%s\033l<%u>",
MU_LOGMODE_LOCUS,
strlen (mach->locus.mu_file), mach->locus.mu_file,
mach->locus.mu_line);
if (mach->identifier)
......@@ -232,9 +234,10 @@ mu_sieve_debug (mu_sieve_machine_t mach, const char *fmt, ...)
va_list ap;
va_start (ap, fmt);
mu_stream_printf (mach->errstream,
"\033s<%d>\033O<%d>\033f<%u>%s\033l<%u>",
MU_LOG_DEBUG, MU_LOGMODE_LOCUS,
mu_stream_printf (mach->errstream, "\033s<%d>", MU_LOG_DEBUG);
if (mach->locus.mu_file)
mu_stream_printf (mach->errstream, "\033O<%d>\033f<%u>%s\033l<%u>",
MU_LOGMODE_LOCUS,
strlen (mach->locus.mu_file), mach->locus.mu_file,
mach->locus.mu_line);
mu_stream_vprintf (mach->errstream, fmt, ap);
......@@ -251,9 +254,10 @@ mu_sieve_log_action (mu_sieve_machine_t mach, const char *action,
if (!mach->logger)
return;
va_start (ap, fmt);
mu_stream_printf (mach->errstream,
"\033s<%d>\033O<%d>\033f<%u>%s\033l<%u>",
MU_LOG_INFO, MU_LOGMODE_LOCUS,
mu_stream_printf (mach->errstream, "\033s<%d>", MU_LOG_INFO);
if (mach->locus.mu_file)
mu_stream_printf (mach->errstream, "\033O<%d>\033f<%u>%s\033l<%u>",
MU_LOGMODE_LOCUS,
strlen (mach->locus.mu_file), mach->locus.mu_file,
mach->locus.mu_line);
mach->logger (mach->data, mach->errstream, mach->msgno, mach->msg,
......