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, ...@@ -368,8 +368,15 @@ mu_c_streamftime (mu_stream_t str, const char *fmt, struct tm *input_tm,
368 rc = mu_stream_printf (str, "%d", tm.tm_year + 1900); 368 rc = mu_stream_printf (str, "%d", tm.tm_year + 1900);
369 break; 369 break;
370 370
371 case 'z':
372 case 'Z': 371 case 'Z':
372 /* The timezone or name or abbreviation. */
373 if (tz && tz->tz_name)
374 {
375 rc = mu_stream_printf (str, "%s", tz->tz_name);
376 break;
377 }
378 /* fall through */
379 case 'z':
373 /* The time-zone as hour offset from GMT, for formatting RFC-822 380 /* The time-zone as hour offset from GMT, for formatting RFC-822
374 dates (e.g. "%a, %d %b %Y %H:%M:%S %z") */ 381 dates (e.g. "%a, %d %b %Y %H:%M:%S %z") */
375 { 382 {
......
...@@ -612,13 +612,12 @@ mu_sieve_compile (mu_sieve_machine_t mach, const char *name) ...@@ -612,13 +612,12 @@ mu_sieve_compile (mu_sieve_machine_t mach, const char *name)
612 612
613 if (mu_sv_lex_begin (name) == 0) 613 if (mu_sv_lex_begin (name) == 0)
614 { 614 {
615 rc = yyparse (); 615 if (yyparse () || mu_sieve_error_count)
616 if (mu_sieve_error_count) 616 rc = MU_ERR_PARSE;
617 rc = 1;
618 mu_sv_lex_finish (); 617 mu_sv_lex_finish ();
619 } 618 }
620 else 619 else
621 rc = 1; 620 rc = MU_ERR_FAILURE;
622 621
623 mu_sieve_machine_finish (mach); 622 mu_sieve_machine_finish (mach);
624 return rc; 623 return rc;
......