delta: preprocess delta line with uci_parse_argument().
[project/uci.git] / file.c
diff --git a/file.c b/file.c
index 3f02c119905febdc52508f6cc79cb5182ea75263..5be2e66b227ee88f627c5af17a52a265dd017b56 100644 (file)
--- a/file.c
+++ b/file.c
@@ -157,7 +157,6 @@ static void parse_double_quote(struct uci_context *ctx, int *target)
                        break;
                }
        }
-       uci_parse_error(ctx, "unterminated \"");
 }
 
 /*
@@ -180,14 +179,13 @@ static void parse_single_quote(struct uci_context *ctx, int *target)
                        /* Multi-line str value */
                        uci_getln(ctx, pctx->pos);
                        if (!pctx_cur_char(pctx))
-                               uci_parse_error(ctx, "EOF with unterminated \"");
+                               uci_parse_error(ctx, "EOF with unterminated '");
 
                        break;
                default:
                        addc(ctx, target, &pctx->pos);
                }
        }
-       uci_parse_error(ctx, "unterminated '");
 }
 
 /*
@@ -280,13 +278,8 @@ int uci_parse_argument(struct uci_context *ctx, FILE *stream, char **str, char *
                uci_alloc_parse_context(ctx);
 
        ctx->pctx->file = stream;
-
-       if (!*str) {
+       if (!*str)
                uci_getln(ctx, 0);
-               *str = ctx->pctx->buf;
-       } else {
-               UCI_ASSERT(ctx, ctx->pctx->pos == *str - ctx->pctx->buf);
-       }
 
        /*FIXME do we need to skip empty lines? */
        ofs_result = next_arg(ctx, false, false);