projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a428a41
)
fix uci_parse_tuple
author
Felix Fietkau
<nbd@openwrt.org>
Tue, 5 Feb 2008 20:25:00 +0000
(21:25 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Tue, 5 Feb 2008 20:25:00 +0000
(21:25 +0100)
util.c
patch
|
blob
|
history
diff --git
a/util.c
b/util.c
index
bc137c3
..
1d71335
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-97,30
+97,29
@@
int uci_parse_tuple(struct uci_context *ctx, char *str, char **package, char **s
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, str && package && section && option);
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, str && package && section && option);
+ last = strchr(str, '=');
+ if (last) {
+ *last = 0;
+ last++;
+ }
+
*package = strtok(str, ".");
if (!*package || !uci_validate_name(*package))
goto error;
*package = strtok(str, ".");
if (!*package || !uci_validate_name(*package))
goto error;
- last = *package;
*section = strtok(NULL, ".");
if (!*section)
goto lastval;
*section = strtok(NULL, ".");
if (!*section)
goto lastval;
- last = *section;
*option = strtok(NULL, ".");
if (!*option)
goto lastval;
*option = strtok(NULL, ".");
if (!*option)
goto lastval;
- last = *option;
-
lastval:
lastval:
- last = strchr(last, '=');
if (last) {
if (!value)
goto error;
if (last) {
if (!value)
goto error;
- *last = 0;
- last++;
if (!*last)
goto error;
*value = last;
if (!*last)
goto error;
*value = last;