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.save() with cursors
[project/uci.git]
/
cli.c
diff --git
a/cli.c
b/cli.c
index
46da45a
..
305d9fe
100644
(file)
--- a/
cli.c
+++ b/
cli.c
@@
-202,6
+202,11
@@
static int package_cmd(int cmd, char *tuple)
uci_export(ctx, stdout, ptr.p, true);
break;
case CMD_SHOW:
uci_export(ctx, stdout, ptr.p, true);
break;
case CMD_SHOW:
+ if (!(ptr.flags & UCI_LOOKUP_COMPLETE)) {
+ ctx->err = UCI_ERR_NOTFOUND;
+ cli_perror();
+ return 1;
+ }
switch(e->type) {
case UCI_TYPE_PACKAGE:
uci_show_package(ptr.p);
switch(e->type) {
case UCI_TYPE_PACKAGE:
uci_show_package(ptr.p);
@@
-338,6
+343,11
@@
static int uci_do_section_cmd(int cmd, int argc, char **argv)
e = ptr.last;
switch(cmd) {
case CMD_GET:
e = ptr.last;
switch(cmd) {
case CMD_GET:
+ if (!(ptr.flags & UCI_LOOKUP_COMPLETE)) {
+ ctx->err = UCI_ERR_NOTFOUND;
+ cli_perror();
+ return 1;
+ }
switch(e->type) {
case UCI_TYPE_SECTION:
printf("%s\n", ptr.s->type);
switch(e->type) {
case UCI_TYPE_SECTION:
printf("%s\n", ptr.s->type);