summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/registry/tools')
-rw-r--r--source4/lib/registry/tools/regshell.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index d60ca1ff46..18399b5bda 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -39,18 +39,17 @@ static REG_KEY *cmd_set(REG_KEY *cur, int argc, char **argv)
static REG_KEY *cmd_ck(REG_KEY *cur, int argc, char **argv)
{
- REG_KEY *new;
+ REG_KEY *new = NULL;
WERROR error;
if(argc < 2) {
new = cur;
} else {
error = reg_open_key(cur, argv[1], &new);
if(!W_ERROR_IS_OK(error)) {
- DEBUG(0, ("Error opening specified key\n"));
+ DEBUG(0, ("Error opening specified key: %s\n", win_errstr(error)));
+ return NULL;
}
- }
-
- if(!new) new = cur;
+ }
printf("Current path is: %s\n", reg_key_get_path(new));