Commit c8a26bc9 c8a26bc9014fbf2660072fd25faf1fa91c474dff by Sergey Poznyakoff

Minor changes.

* libmailutils/datetime/streamftime.c (mu_c_streamftime): Handle
%Z separately.
* libmu_sieve/sieve.y (mu_sieve_compile): Return MU_ERR_PARSE on
errors.
1 parent a4b7febb
......@@ -368,8 +368,15 @@ mu_c_streamftime (mu_stream_t str, const char *fmt, struct tm *input_tm,
rc = mu_stream_printf (str, "%d", tm.tm_year + 1900);
break;
case 'z':
case 'Z':
/* The timezone or name or abbreviation. */
if (tz && tz->tz_name)
{
rc = mu_stream_printf (str, "%s", tz->tz_name);
break;
}
/* fall through */
case 'z':
/* The time-zone as hour offset from GMT, for formatting RFC-822
dates (e.g. "%a, %d %b %Y %H:%M:%S %z") */
{
......
......@@ -612,13 +612,12 @@ mu_sieve_compile (mu_sieve_machine_t mach, const char *name)
if (mu_sv_lex_begin (name) == 0)
{
rc = yyparse ();
if (mu_sieve_error_count)
rc = 1;
if (yyparse () || mu_sieve_error_count)
rc = MU_ERR_PARSE;
mu_sv_lex_finish ();
}
else
rc = 1;
rc = MU_ERR_FAILURE;
mu_sieve_machine_finish (mach);
return rc;
......