projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
file: defer checking the tmpfile until it is actually needed.
[project/uci.git]
/
delta.c
diff --git
a/delta.c
b/delta.c
index
459d2c7
..
e9c79ab
100644
(file)
--- a/
delta.c
+++ b/
delta.c
@@
-293,13
+293,15
@@
static int uci_load_delta_file(struct uci_context *ctx, struct uci_package *p, c
UCI_TRAP_SAVE(ctx, done);
stream = uci_open_stream(ctx, filename, NULL, SEEK_SET, flush, false);
UCI_TRAP_SAVE(ctx, done);
stream = uci_open_stream(ctx, filename, NULL, SEEK_SET, flush, false);
+ UCI_TRAP_RESTORE(ctx);
+
if (p)
changes = uci_parse_delta(ctx, stream, p);
if (p)
changes = uci_parse_delta(ctx, stream, p);
- UCI_TRAP_RESTORE(ctx);
+
done:
if (f)
*f = stream;
done:
if (f)
*f = stream;
- else
if (stream)
+ else
uci_close_stream(stream);
return changes;
}
uci_close_stream(stream);
return changes;
}