diff --git a/src/lib-sieve/ext-encoded-character.c b/src/lib-sieve/ext-encoded-character.c index 23608ea468187dc2b36b96107c82c7271a10cc9f..dd5f1154392237fcc1abc6c2d0c5ef39f564db9c 100644 --- a/src/lib-sieve/ext-encoded-character.c +++ b/src/lib-sieve/ext-encoded-character.c @@ -164,7 +164,7 @@ bool arg_encoded_string_validate const char *strval = (const char *) str_data(str); const char *strend = strval + str_len(str); - T_FRAME( + T_BEGIN { tmpstr = t_str_new(32); p = strval; @@ -234,7 +234,7 @@ bool arg_encoded_string_validate p++; } } - ); + } T_END; if ( newstr != NULL ) { if ( strstart != strend ) diff --git a/src/lib-sieve/plugins/body/ext-body-common.c b/src/lib-sieve/plugins/body/ext-body-common.c index 9c8bac6cc6fca0c901b3a9484dd53589b8f42697..14e1e1ac0ad67b08510aaafef7f0f813919606d4 100644 --- a/src/lib-sieve/plugins/body/ext-body-common.c +++ b/src/lib-sieve/plugins/body/ext-body-common.c @@ -200,10 +200,10 @@ static bool ext_body_parts_add_missing continue; } - T_FRAME( + T_BEGIN { body_part->content_type = p_strdup(ctx->pool, _parse_content_type(block.hdr)); - ); + } T_END; continue; } @@ -263,11 +263,11 @@ bool ext_body_get_content bool result = TRUE; struct ext_body_message_context *ctx = ext_body_get_context(renv->msgctx); - T_FRAME( + T_BEGIN { if ( !ext_body_parts_add_missing (renv->msgdata, ctx, content_types, decode_to_plain != 0) ) result = FALSE; - ); + } T_END; if ( !result ) return FALSE; diff --git a/src/lib-sieve/sieve-address-parts.c b/src/lib-sieve/sieve-address-parts.c index fc6f4d3f09ea3a6862d6d69074cadc050f14714c..26e72f7b78730d8584aef63a2d49be39651dd313 100644 --- a/src/lib-sieve/sieve-address-parts.c +++ b/src/lib-sieve/sieve-address-parts.c @@ -350,7 +350,7 @@ bool sieve_address_match bool matched = FALSE; const struct message_address *addr; - T_FRAME( + T_BEGIN { addr = message_address_parse (pool_datastack_create(), (const unsigned char *) data, strlen(data), 256, FALSE); @@ -370,7 +370,7 @@ bool sieve_address_match addr = addr->next; } - ); + } T_END; return matched; } diff --git a/src/lib-sieve/sieve-ast.c b/src/lib-sieve/sieve-ast.c index c3bef9fb789cf24f5440a25b0a317e25e6104be3..0b02aacd12a282b62735db094225e7411a277217 100644 --- a/src/lib-sieve/sieve-ast.c +++ b/src/lib-sieve/sieve-ast.c @@ -96,9 +96,11 @@ void sieve_ast_error { struct sieve_script *script = node->ast->script; - T_FRAME(vfunc(ehandler, - t_strdup_printf("%s:%d", sieve_script_name(script), - sieve_ast_node_line(node)), fmt, args)); + T_BEGIN { + vfunc(ehandler, + t_strdup_printf("%s:%d", sieve_script_name(script), + sieve_ast_node_line(node)), fmt, args); + } T_END; } @@ -641,13 +643,13 @@ void sieve_ast_unparse(struct sieve_ast *ast) { printf("Unparsing Abstract Syntax Tree:\n"); - T_FRAME( + T_BEGIN { command = sieve_ast_command_first(sieve_ast_root(ast)); while ( command != NULL ) { sieve_ast_unparse_command(command, 0); command = sieve_ast_command_next(command); } - ); + } T_END; } diff --git a/src/lib-sieve/sieve-binary.c b/src/lib-sieve/sieve-binary.c index 2c174d1f7529084595df7ebd35be9619b207888d..d981897b013c181c0778c486c88aadd0e16ade2e 100644 --- a/src/lib-sieve/sieve-binary.c +++ b/src/lib-sieve/sieve-binary.c @@ -956,7 +956,7 @@ static bool _sieve_binary_load_extensions(struct sieve_binary *sbin) return FALSE; for ( i = 0; result && i < count; i++ ) { - T_FRAME( + T_BEGIN { string_t *extension; int ext_id; @@ -978,7 +978,7 @@ static bool _sieve_binary_load_extensions(struct sieve_binary *sbin) } } else result = FALSE; - ); + } T_END; } return result; @@ -994,7 +994,7 @@ static bool _sieve_binary_open(struct sieve_binary *sbin) /* Verify header */ - T_FRAME( + T_BEGIN { header = LOAD_HEADER(sbin, &offset, const struct sieve_binary_header); if ( header == NULL ) { i_error("sieve: opened binary %s is not even large enough " @@ -1016,7 +1016,7 @@ static bool _sieve_binary_open(struct sieve_binary *sbin) } else { blk_count = header->blocks; } - ); + } T_END; if ( !result ) return FALSE; @@ -1025,20 +1025,20 @@ static bool _sieve_binary_open(struct sieve_binary *sbin) printf("BLOCKS: %d\n", blk_count); for ( i = 0; i < blk_count && result; i++ ) { - T_FRAME( + T_BEGIN { if ( !_load_block_index_record(sbin, &offset, i) ) { i_error("sieve: block index record %d of opened binary %s is corrupt", i, sbin->path); result = FALSE; } - ); + } T_END; } if ( !result ) return FALSE; /* Load extensions used by this binary */ - T_FRAME( + T_BEGIN { extensions =_load_block(sbin, &offset, 0); if ( extensions == NULL ) { result = FALSE; @@ -1047,7 +1047,7 @@ static bool _sieve_binary_open(struct sieve_binary *sbin) sbin->path); result = FALSE; } - ); + } T_END; return result; } @@ -1071,13 +1071,13 @@ static bool _sieve_binary_load(struct sieve_binary *sbin) /* Load the other blocks */ for ( i = 1; result && i < blk_count; i++ ) { - T_FRAME( + T_BEGIN { if ( _load_block(sbin, &offset, i) == NULL ) { i_error("sieve: block %d of loaded binary %s is corrupt", i, sbin->path); result = FALSE; } - ); + } T_END; } return result; diff --git a/src/lib-sieve/sieve-commands.c b/src/lib-sieve/sieve-commands.c index 6d1a98d8bca59d2b780a731cf4d1b49d0d08eddf..29c77c338adb89fffeee19d36d6cc9a0c5e854f5 100644 --- a/src/lib-sieve/sieve-commands.c +++ b/src/lib-sieve/sieve-commands.c @@ -112,9 +112,12 @@ static bool arg_string_list_generate if ( sieve_ast_strlist_count(arg) == 1 ) return ( sieve_generate_argument (generator, sieve_ast_strlist_first(arg), context) ); - else - T_FRAME( result=emit_string_list_operand(generator, arg, context) ); - + else { + T_BEGIN { + result=emit_string_list_operand(generator, arg, context); + } T_END; + } + return result; } diff --git a/src/lib-sieve/sieve-error.c b/src/lib-sieve/sieve-error.c index 971f0719621443ad59c1bc11d2ce6a820e2373aa..61621309736fc657aaf412b1abe17560d0a3e4bc 100644 --- a/src/lib-sieve/sieve-error.c +++ b/src/lib-sieve/sieve-error.c @@ -256,14 +256,14 @@ static void sieve_logfile_vprintf if ( ehandler->stream == NULL ) return; - T_FRAME( + T_BEGIN { outbuf = t_str_new(256); str_printfa(outbuf, "%s: %s: ", location, prefix); str_vprintfa(outbuf, fmt, args); str_append(outbuf, ".\n"); o_stream_send(ehandler->stream, str_data(outbuf), str_len(outbuf)); - ); + } T_END; } inline static void sieve_logfile_printf diff --git a/src/lib-sieve/sieve-error.h b/src/lib-sieve/sieve-error.h index 787ed7c67b9366c7b58bf70587c97157f70d9eb3..12d46287395246e273db893775d084cb41b3ad0d 100644 --- a/src/lib-sieve/sieve-error.h +++ b/src/lib-sieve/sieve-error.h @@ -48,7 +48,9 @@ inline static void sieve_error va_list args; va_start(args, fmt); - T_FRAME(sieve_verror(ehandler, location, fmt, args)); + T_BEGIN { + sieve_verror(ehandler, location, fmt, args); + } T_END; va_end(args); } @@ -60,8 +62,10 @@ inline static void sieve_warning va_list args; va_start(args, fmt); - T_FRAME(sieve_vwarning(ehandler, location, fmt, args)); - + T_BEGIN { + sieve_vwarning(ehandler, location, fmt, args); + } T_END; + va_end(args); } @@ -72,7 +76,9 @@ inline static void sieve_info va_list args; va_start(args, fmt); - T_FRAME(sieve_vinfo(ehandler, location, fmt, args)); + T_BEGIN { + sieve_vinfo(ehandler, location, fmt, args); + } T_END; va_end(args); } @@ -84,7 +90,9 @@ inline static void sieve_critical va_list args; va_start(args, fmt); - T_FRAME(sieve_vcritical(ehandler, location, fmt, args)); + T_BEGIN { + sieve_vcritical(ehandler, location, fmt, args); + } T_END; va_end(args); } diff --git a/src/lib-sieve/sieve-generator.c b/src/lib-sieve/sieve-generator.c index 082b5ca63e98b47fda3864b9e5f58057f6e45f1f..edc87c55ff5fadca8a3b3cf3bcb67e3915e706ed 100644 --- a/src/lib-sieve/sieve-generator.c +++ b/src/lib-sieve/sieve-generator.c @@ -337,13 +337,13 @@ bool sieve_generate_block bool result = TRUE; struct sieve_ast_node *command; - T_FRAME( + T_BEGIN { command = sieve_ast_command_first(block); while ( result && command != NULL ) { result = sieve_generate_command(generator, command); command = sieve_ast_command_next(command); } - ); + } T_END; return result; } diff --git a/src/lib-sieve/sieve-interpreter.c b/src/lib-sieve/sieve-interpreter.c index b07e23fbcb998f301691ea15733166ab793395e6..f268e95e41cc54604ebd671ef9b66008864cc86f 100644 --- a/src/lib-sieve/sieve-interpreter.c +++ b/src/lib-sieve/sieve-interpreter.c @@ -206,9 +206,9 @@ void sieve_runtime_error va_list args; va_start(args, fmt); - T_FRAME( + T_BEGIN { sieve_verror(runenv->interp->ehandler, _get_location(runenv), fmt, args); - ); + } T_END; va_end(args); } @@ -218,9 +218,9 @@ void sieve_runtime_warning va_list args; va_start(args, fmt); - T_FRAME( + T_BEGIN { sieve_vwarning(runenv->interp->ehandler, _get_location(runenv), fmt, args); - ); + } T_END; va_end(args); } @@ -230,9 +230,9 @@ void sieve_runtime_log va_list args; va_start(args, fmt); - T_FRAME( + T_BEGIN { sieve_vinfo(runenv->interp->ehandler, _get_location(runenv), fmt, args); - ); + } T_END; va_end(args); } diff --git a/src/lib-sieve/sieve-lexer.c b/src/lib-sieve/sieve-lexer.c index 287d787ad0892ad8ac68e6338bbb9e7e82ed31bd..0e692bc2800d952d796767206cbedea8feb295c3 100644 --- a/src/lib-sieve/sieve-lexer.c +++ b/src/lib-sieve/sieve-lexer.c @@ -51,10 +51,12 @@ inline static void sieve_lexer_error va_list args; va_start(args, fmt); - T_FRAME(sieve_verror(lexer->ehandler, - t_strdup_printf("%s:%d", sieve_script_name(lexer->script), - lexer->current_line), - fmt, args)); + T_BEGIN { + sieve_verror(lexer->ehandler, + t_strdup_printf("%s:%d", sieve_script_name(lexer->script), + lexer->current_line), + fmt, args); + } T_END; va_end(args); } @@ -65,10 +67,12 @@ inline static void sieve_lexer_warning va_list args; va_start(args, fmt); - T_FRAME(sieve_vwarning(lexer->ehandler, - t_strdup_printf("%s:%d", sieve_script_name(lexer->script), + T_BEGIN { + sieve_vwarning(lexer->ehandler, + t_strdup_printf("%s:%d", sieve_script_name(lexer->script), lexer->current_line), - fmt, args)); + fmt, args); + } T_END; va_end(args); } diff --git a/src/lib-sieve/sieve-parser.c b/src/lib-sieve/sieve-parser.c index 48565392a191ff51540b9625cd782c049ad292d9..cb52f0be7bc8aec8136d5deb145f079baa9c4ea9 100644 --- a/src/lib-sieve/sieve-parser.c +++ b/src/lib-sieve/sieve-parser.c @@ -39,11 +39,13 @@ inline static void sieve_parser_error /* Don't report a parse error if the lexer complained already */ if ( sieve_lexer_current_token(parser->lexer) != STT_ERROR ) { - T_FRAME(sieve_verror(parser->ehandler, - t_strdup_printf("%s:%d", - sieve_script_name(parser->script), - sieve_lexer_current_line(parser->lexer)), - fmt, args)); + T_BEGIN { + sieve_verror(parser->ehandler, + t_strdup_printf("%s:%d", + sieve_script_name(parser->script), + sieve_lexer_current_line(parser->lexer)), + fmt, args); + } T_END; } va_end(args); @@ -55,11 +57,13 @@ inline static void sieve_parser_warning va_list args; va_start(args, fmt); - T_FRAME(sieve_vwarning(parser->ehandler, - t_strdup_printf("%s:%d", - sieve_script_name(parser->script), - sieve_lexer_current_line(parser->lexer)), - fmt, args)); + T_BEGIN { + sieve_vwarning(parser->ehandler, + t_strdup_printf("%s:%d", + sieve_script_name(parser->script), + sieve_lexer_current_line(parser->lexer)), + fmt, args); + } T_END; va_end(args); } diff --git a/src/lib-sieve/sieve-validator.c b/src/lib-sieve/sieve-validator.c index 80735e93ae236374fe0b5c2cf5e07bd484c2e5de..45a7ab7a811104c713dfcf4fbd7dc237e43c9254 100644 --- a/src/lib-sieve/sieve-validator.c +++ b/src/lib-sieve/sieve-validator.c @@ -878,13 +878,13 @@ static bool sieve_validate_block(struct sieve_validator *validator, struct sieve bool result = TRUE; struct sieve_ast_node *command; - T_FRAME( + T_BEGIN { command = sieve_ast_command_first(block); while ( command != NULL ) { result = sieve_validate_command(validator, command) && result; command = sieve_ast_command_next(command); } - ); + } T_END; return result; } diff --git a/src/lib-sieve/sieve.c b/src/lib-sieve/sieve.c index c0d269268d165d3fec906585459eca64dcca0e19..3062207fd56172b95d695b220abc083ec24ffb39 100644 --- a/src/lib-sieve/sieve.c +++ b/src/lib-sieve/sieve.c @@ -145,7 +145,7 @@ struct sieve_binary *sieve_open if ( script == NULL ) return NULL; - T_FRAME( + T_BEGIN { binpath = sieve_script_binpath(script); sbin = sieve_binary_open(binpath, script); @@ -165,7 +165,7 @@ struct sieve_binary *sieve_open if ( sbin != NULL ) (void) sieve_binary_save(sbin, binpath); } - ); + } T_END; sieve_script_unref(&script); diff --git a/src/plugins/lda-sieve/lda-sieve-plugin.c b/src/plugins/lda-sieve/lda-sieve-plugin.c index b79714b4510b2ca45cf6bde1ea789e8b39deff14..2e11ec30d2b0384d9f0128beaa61b96384fcfe29 100644 --- a/src/plugins/lda-sieve/lda-sieve-plugin.c +++ b/src/plugins/lda-sieve/lda-sieve-plugin.c @@ -151,10 +151,10 @@ static int lda_sieve_deliver_mail if (getenv("DEBUG") != NULL) i_info("sieve: Using sieve path: %s", script_path); - T_FRAME( + T_BEGIN { ret = lda_sieve_run(namespaces, mail, script_path, destaddr, - getenv("USER"), mailbox) - ); + getenv("USER"), mailbox); + } T_END; return ( ret >= 0 ? 1 : -1 ); }