summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2008-09-09 18:01:20 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2008-09-09 18:01:20 +0200
commit8b6b8513909fb0c5acabea060921ed2034b3284d (patch)
tree8de94e76a0b886bb016cd53f3590e0c8c6c8b625
parent37a63fb039a48e5283cdd7504b9385068508c9bd (diff)
downloadsamba-8b6b8513909fb0c5acabea060921ed2034b3284d.tar.gz
samba-8b6b8513909fb0c5acabea060921ed2034b3284d.tar.bz2
samba-8b6b8513909fb0c5acabea060921ed2034b3284d.zip
Two useful "regshell" improvements
This patch corrects the "change key" command (Follow up isn't supported yet) and adds a newline in a error message. (This used to be commit d1052dc42ef591208cfbf7059b28a078f6d4f0bf)
-rw-r--r--source4/lib/registry/tools/regshell.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 4e859df3f6..ee8f366e6e 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;
}