projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add strict mode flag (enabled by default, can be disabled to ignore lines with parser...
[project/uci.git]
/
file.c
diff --git
a/file.c
b/file.c
index
b8aa865
..
be63247
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-502,8
+502,18
@@
int uci_import(struct uci_context *ctx, FILE *stream, const char *name, struct u
while (!feof(pctx->file)) {
uci_getln(ctx, 0);
while (!feof(pctx->file)) {
uci_getln(ctx, 0);
+
+ UCI_TRAP_SAVE(ctx, error);
if (pctx->buf[0])
uci_parse_line(ctx, single);
if (pctx->buf[0])
uci_parse_line(ctx, single);
+ UCI_TRAP_RESTORE(ctx);
+ continue;
+error:
+ if (ctx->flags & UCI_FLAG_PERROR)
+ uci_perror(ctx, NULL);
+ if ((ctx->errno != UCI_ERR_PARSE) ||
+ (ctx->flags & UCI_FLAG_STRICT))
+ UCI_THROW(ctx, ctx->errno);
}
if (package)
}
if (package)