diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2015-04-09 21:48:47 +0800 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-04-09 16:55:17 +0200 |
commit | 556215152a216c179fe2ca7db9b1de7036ceda60 (patch) | |
tree | d3faa11503c753c19d1940bdca19c21928ddb543 | |
parent | a2bbe06ed1aced403cd321753722e34628b453d8 (diff) | |
download | uci-556215152a216c179fe2ca7db9b1de7036ceda60.tar.gz |
file: reset parsing position on starting over a newline.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
-rw-r--r-- | file.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -278,10 +278,11 @@ 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) { + ctx->pctx->pos = 0; uci_getln(ctx, 0); + } - /*FIXME do we need to skip empty lines? */ ofs_result = next_arg(ctx, false, false, false); *result = pctx_str(ctx->pctx, ofs_result); *str = pctx_cur_str(ctx->pctx); |