projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
718a82c
)
fix uci revert
author
Felix Fietkau
<nbd@pi.lan>
Fri, 22 Aug 2008 20:08:06 +0000
(22:08 +0200)
committer
Felix Fietkau
<nbd@pi.lan>
Fri, 22 Aug 2008 20:08:06 +0000
(22:08 +0200)
history.c
patch
|
blob
|
history
diff --git
a/history.c
b/history.c
index
1fe2900
..
789cd87
100644
(file)
--- a/
history.c
+++ b/
history.c
@@
-332,7
+332,7
@@
int uci_revert(struct uci_context *ctx, struct uci_ptr *ptr)
char *option = NULL;
UCI_HANDLE_ERR(ctx);
char *option = NULL;
UCI_HANDLE_ERR(ctx);
- expand_ptr(ctx, ptr,
tru
e);
+ expand_ptr(ctx, ptr,
fals
e);
UCI_ASSERT(ctx, ptr->p->has_history);
/*
UCI_ASSERT(ctx, ptr->p->has_history);
/*
@@
-348,8
+348,10
@@
int uci_revert(struct uci_context *ctx, struct uci_ptr *ptr)
/* NB: need to clone package, section and option names,
* as they may get freed on uci_free_package() */
package = uci_strdup(ctx, ptr->p->e.name);
/* NB: need to clone package, section and option names,
* as they may get freed on uci_free_package() */
package = uci_strdup(ctx, ptr->p->e.name);
- section = uci_strdup(ctx, ptr->section);
- option = uci_strdup(ctx, ptr->option);
+ if (ptr->section)
+ section = uci_strdup(ctx, ptr->section);
+ if (ptr->option)
+ option = uci_strdup(ctx, ptr->option);
uci_free_package(&ptr->p);
uci_filter_history(ctx, package, section, option);
uci_free_package(&ptr->p);
uci_filter_history(ctx, package, section, option);