From: Timo Sirainen Date: Sun, 24 Jan 2016 20:06:30 +0000 (+0200) Subject: config: Fixed '\' line continuation to work again. X-Git-Tag: 2.2.22.rc1~293 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0fa40bfd73cedc311ff2e0ae90707836382bfc8c;p=thirdparty%2Fdovecot%2Fcore.git config: Fixed '\' line continuation to work again. This had been broken for many years. --- diff --git a/src/config/config-parser-private.h b/src/config/config-parser-private.h index fb0f0ced7f..7cd801c3f7 100644 --- a/src/config/config-parser-private.h +++ b/src/config/config-parser-private.h @@ -6,6 +6,7 @@ enum config_line_type { CONFIG_LINE_TYPE_SKIP, + CONFIG_LINE_TYPE_CONTINUE, CONFIG_LINE_TYPE_ERROR, CONFIG_LINE_TYPE_KEYVALUE, CONFIG_LINE_TYPE_KEYFILE, diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 087f46e111..cb7910d8fe 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -601,7 +601,7 @@ config_parse_line(struct config_parser_context *ctx, len--; str_append_n(full_line, line, len); str_append_c(full_line, ' '); - return CONFIG_LINE_TYPE_SKIP; + return CONFIG_LINE_TYPE_CONTINUE; } if (str_len(full_line) > 0) { str_append(full_line, line); @@ -843,6 +843,8 @@ void config_parser_apply_line(struct config_parser_context *ctx, switch (type) { case CONFIG_LINE_TYPE_SKIP: break; + case CONFIG_LINE_TYPE_CONTINUE: + i_unreached(); case CONFIG_LINE_TYPE_ERROR: ctx->error = p_strdup(ctx->pool, value); break; @@ -969,6 +971,8 @@ prevfile: type = config_parse_line(&ctx, line, full_line, &key, &value); str_truncate(ctx.str, ctx.pathlen); + if (type == CONFIG_LINE_TYPE_CONTINUE) + continue; T_BEGIN { handled = old_settings_handle(&ctx, type, key, value); diff --git a/src/config/old-set-parser.c b/src/config/old-set-parser.c index 6c4b80db2a..85c6260390 100644 --- a/src/config/old-set-parser.c +++ b/src/config/old-set-parser.c @@ -579,6 +579,7 @@ bool old_settings_handle(struct config_parser_context *ctx, { switch (type) { case CONFIG_LINE_TYPE_SKIP: + case CONFIG_LINE_TYPE_CONTINUE: case CONFIG_LINE_TYPE_ERROR: case CONFIG_LINE_TYPE_INCLUDE: case CONFIG_LINE_TYPE_INCLUDE_TRY: