projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add initial version of the shell api
[project/uci.git]
/
file.c
diff --git
a/file.c
b/file.c
index
a58ac55
..
1abe8ff
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-119,7
+119,7
@@
static void uci_parse_config(struct uci_context *ctx, char **str)
*str += strlen(*str) + 1;
type = next_arg(ctx, str, true, false);
*str += strlen(*str) + 1;
type = next_arg(ctx, str, true, false);
- if (!uci_validate_
str(type, fals
e))
+ if (!uci_validate_
type(typ
e))
uci_parse_error(ctx, type, "invalid character in field");
name = next_arg(ctx, str, false, true);
assert_eol(ctx, str);
uci_parse_error(ctx, type, "invalid character in field");
name = next_arg(ctx, str, false, true);
assert_eol(ctx, str);
@@
-353,7
+353,7
@@
int uci_import(struct uci_context *ctx, FILE *stream, const char *name, struct u
* NB: the config file can still override the package name
*/
if (name) {
* NB: the config file can still override the package name
*/
if (name) {
- UCI_ASSERT(ctx, uci_validate_
str(name, fals
e));
+ UCI_ASSERT(ctx, uci_validate_
package(nam
e));
pctx->name = name;
}
pctx->name = name;
}
@@
-394,7
+394,7
@@
static char *uci_config_path(struct uci_context *ctx, const char *name)
{
char *filename;
{
char *filename;
- UCI_ASSERT(ctx, uci_validate_
str(name, fals
e));
+ UCI_ASSERT(ctx, uci_validate_
package(nam
e));
filename = uci_malloc(ctx, strlen(name) + strlen(ctx->confdir) + 2);
sprintf(filename, "%s/%s", ctx->confdir, name);
filename = uci_malloc(ctx, strlen(name) + strlen(ctx->confdir) + 2);
sprintf(filename, "%s/%s", ctx->confdir, name);
@@
-520,7
+520,7
@@
static char **uci_list_config_files(struct uci_context *ctx)
if (!p)
continue;
if (!p)
continue;
- if (!uci_validate_
nam
e(p))
+ if (!uci_validate_
packag
e(p))
continue;
configs[i] = buf;
continue;
configs[i] = buf;
@@
-528,6
+528,7
@@
static char **uci_list_config_files(struct uci_context *ctx)
buf += strlen(buf) + 1;
}
free(dir);
buf += strlen(buf) + 1;
}
free(dir);
+ globfree(&globbuf);
return configs;
}
return configs;
}