]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Fixed '\' line continuation to work again.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 24 Jan 2016 20:06:30 +0000 (22:06 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 24 Jan 2016 20:06:30 +0000 (22:06 +0200)
This had been broken for many years.

src/config/config-parser-private.h
src/config/config-parser.c
src/config/old-set-parser.c

index fb0f0ced7ffc2fdbfab72e1a44f1648562135683..7cd801c3f7f3cd46e74ebdcf5f171940fb63fe68 100644 (file)
@@ -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,
index 087f46e111c3e9b2eb8609015c7e0e603fb07954..cb7910d8fe8db257927c70ba0d5ff5611f779a1c 100644 (file)
@@ -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);
index 6c4b80db2abd2c9ebbbc751cd269a8e28face2c6..85c6260390c8ae91679d5201b57e7887257036d4 100644 (file)
@@ -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: