projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix `uci import` with not yet existing packages
[project/uci.git]
/
blob.c
diff --git
a/blob.c
b/blob.c
index
98c8d8a
..
c8e5dc9
100644
(file)
--- a/
blob.c
+++ b/
blob.c
@@
-25,6
+25,7
@@
uci_attr_to_blob(struct blob_buf *b, const char *str,
{
char *err;
int intval;
{
char *err;
int intval;
+ long long llval;
switch (type) {
case BLOBMSG_TYPE_STRING:
switch (type) {
case BLOBMSG_TYPE_STRING:
@@
-47,6
+48,13
@@
uci_attr_to_blob(struct blob_buf *b, const char *str,
blobmsg_add_u32(b, name, intval);
break;
blobmsg_add_u32(b, name, intval);
break;
+ case BLOBMSG_TYPE_INT64:
+ llval = strtoll(str, &err, 0);
+ if (*err)
+ return false;
+
+ blobmsg_add_u64(b, name, llval);
+ break;
default:
return false;
}
default:
return false;
}
@@
-105,11
+113,16
@@
__uci_element_to_blob(struct blob_buf *b, struct uci_element *e,
types |= 1 << attr->type;
if (attr->type == BLOBMSG_TYPE_ARRAY) {
types |= 1 << attr->type;
if (attr->type == BLOBMSG_TYPE_ARRAY) {
- if (!p->info)
- continue;
+ int element_type = 0;
+
+ if (p->info)
+ element_type = p->info[i].type;
+
+ if (!element_type)
+ element_type = BLOBMSG_TYPE_STRING;
array = blobmsg_open_array(b, attr->name);
array = blobmsg_open_array(b, attr->name);
- uci_array_to_blob(b, o,
p->info[i].
type);
+ uci_array_to_blob(b, o,
element_
type);
blobmsg_close_array(b, array);
ret++;
continue;
blobmsg_close_array(b, array);
ret++;
continue;