diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-09-10 14:09:07 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-09-10 14:09:07 +1000 |
commit | 9bc4d3ecba6395be2dff195fdc1ae74d07155a42 (patch) | |
tree | 354e6216080b6e21cdc2ff2e5368ee4a99aa535b /source4/lib/registry/tools/regshell.c | |
parent | ba22de3d4fcba466d2829df47fb05c85eda2f98f (diff) | |
parent | ce288824bb4a095c5020449a79eb83fad81e8480 (diff) | |
download | samba-9bc4d3ecba6395be2dff195fdc1ae74d07155a42.tar.gz samba-9bc4d3ecba6395be2dff195fdc1ae74d07155a42.tar.bz2 samba-9bc4d3ecba6395be2dff195fdc1ae74d07155a42.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-abartlet
(This used to be commit ed26195d0eda6dd1ca14508cfd31a48dde79d44f)
Diffstat (limited to 'source4/lib/registry/tools/regshell.c')
-rw-r--r-- | source4/lib/registry/tools/regshell.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 4e859df3f6..98f7f02c38 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -162,9 +162,7 @@ static WERROR cmd_ck(struct regshell_context *ctx, int argc, char **argv) struct registry_key *new = NULL; WERROR error; - if(argc < 2) { - new = ctx->current; - } else { + if(argc == 2) { error = reg_open_key(ctx->registry, ctx->current, argv[1], &new); if(!W_ERROR_IS_OK(error)) { @@ -172,11 +170,11 @@ static WERROR cmd_ck(struct regshell_context *ctx, int argc, char **argv) win_errstr(error))); return error; } - } - ctx->path = talloc_asprintf(ctx, "%s\\%s", ctx->path, argv[1]); - printf("Current path is: %s\n", ctx->path); - ctx->current = new; + ctx->path = talloc_asprintf(ctx, "%s\\%s", ctx->path, argv[1]); + ctx->current = new; + } + printf("New path is: %s\n", ctx->path); return WERR_OK; } @@ -188,7 +186,7 @@ static WERROR cmd_print(struct regshell_context *ctx, int argc, char **argv) WERROR error; if (argc != 2) { - fprintf(stderr, "Usage: print <valuename>"); + fprintf(stderr, "Usage: print <valuename>\n"); return WERR_INVALID_PARAM; } @@ -520,8 +518,8 @@ int main(int argc, char **argv) ev_ctx = s4_event_context_init(ctx); if (remote != NULL) { - ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx, - cmdline_credentials); + ctx->registry = reg_common_open_remote(remote, ev_ctx, + cmdline_lp_ctx, cmdline_credentials); } else if (file != NULL) { ctx->current = reg_common_open_file(file, ev_ctx, cmdline_lp_ctx, cmdline_credentials); if (ctx->current == NULL) |