projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lua: include /opt/local/lib and /opt/local/include in the search path on mac os x
[project/uci.git]
/
file.c
diff --git
a/file.c
b/file.c
index
0530eb2
..
c2b0e72
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-398,7
+398,7
@@
static void uci_parse_config(struct uci_context *ctx, char **str)
name = next_arg(ctx, str, false, true);
assert_eol(ctx, str);
name = next_arg(ctx, str, false, true);
assert_eol(ctx, str);
- if (!name) {
+ if (!name
|| !name[0]
) {
ctx->internal = !pctx->merge;
UCI_NESTED(uci_add_section, ctx, pctx->package, type, &pctx->section);
} else {
ctx->internal = !pctx->merge;
UCI_NESTED(uci_add_section, ctx, pctx->package, type, &pctx->section);
} else {
@@
-561,10
+561,10
@@
static void uci_export_package(struct uci_package *p, FILE *stream, bool header)
struct uci_element *s, *o, *i;
if (header)
struct uci_element *s, *o, *i;
if (header)
- fprintf(stream, "package
'%s'
\n", uci_escape(ctx, p->e.name));
+ fprintf(stream, "package
%s
\n", uci_escape(ctx, p->e.name));
uci_foreach_element(&p->sections, s) {
struct uci_section *sec = uci_to_section(s);
uci_foreach_element(&p->sections, s) {
struct uci_section *sec = uci_to_section(s);
- fprintf(stream, "\nconfig
'%s'
", uci_escape(ctx, sec->type));
+ fprintf(stream, "\nconfig
%s
", uci_escape(ctx, sec->type));
if (!sec->anonymous || (ctx->flags & UCI_FLAG_EXPORT_NAME))
fprintf(stream, " '%s'", uci_escape(ctx, sec->e.name));
fprintf(stream, "\n");
if (!sec->anonymous || (ctx->flags & UCI_FLAG_EXPORT_NAME))
fprintf(stream, " '%s'", uci_escape(ctx, sec->e.name));
fprintf(stream, "\n");
@@
-572,12
+572,12
@@
static void uci_export_package(struct uci_package *p, FILE *stream, bool header)
struct uci_option *opt = uci_to_option(o);
switch(opt->type) {
case UCI_TYPE_STRING:
struct uci_option *opt = uci_to_option(o);
switch(opt->type) {
case UCI_TYPE_STRING:
- fprintf(stream, "\toption
'%s'
", uci_escape(ctx, opt->e.name));
+ fprintf(stream, "\toption
%s
", uci_escape(ctx, opt->e.name));
fprintf(stream, " '%s'\n", uci_escape(ctx, opt->v.string));
break;
case UCI_TYPE_LIST:
uci_foreach_element(&opt->v.list, i) {
fprintf(stream, " '%s'\n", uci_escape(ctx, opt->v.string));
break;
case UCI_TYPE_LIST:
uci_foreach_element(&opt->v.list, i) {
- fprintf(stream, "\tlist
'%s'
", uci_escape(ctx, opt->e.name));
+ fprintf(stream, "\tlist
%s
", uci_escape(ctx, opt->e.name));
fprintf(stream, " '%s'\n", uci_escape(ctx, i->name));
}
break;
fprintf(stream, " '%s'\n", uci_escape(ctx, i->name));
}
break;
@@
-619,7
+619,7
@@
int uci_import(struct uci_context *ctx, FILE *stream, const char *name, struct u
uci_alloc_parse_context(ctx);
pctx = ctx->pctx;
pctx->file = stream;
uci_alloc_parse_context(ctx);
pctx = ctx->pctx;
pctx->file = stream;
- if (*package && single) {
+ if (
package &&
*package && single) {
pctx->package = *package;
pctx->merge = true;
}
pctx->package = *package;
pctx->merge = true;
}