summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools/regshell.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2008-09-13 12:26:03 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-21 23:17:59 +0200
commit92e1574d3ddb0edf3173e18c6e0dfc4974bedcf5 (patch)
treeb3a31c12c774d82e40e4cc9d3726c95a3ecac5fc /source4/lib/registry/tools/regshell.c
parent5bf62260505d1e8dfddcb3acef69ef0217841a3f (diff)
downloadsamba-92e1574d3ddb0edf3173e18c6e0dfc4974bedcf5.tar.gz
samba-92e1574d3ddb0edf3173e18c6e0dfc4974bedcf5.tar.bz2
samba-92e1574d3ddb0edf3173e18c6e0dfc4974bedcf5.zip
Registry tools "regshell" and "regtree": Small fixup's
I fixed up my fault regarding the handling of the default value (if it doesn't exist it hasn't the index number zero and you get immediately the subvalues). Then I corrected an error in regshell to find the right registry context.
Diffstat (limited to 'source4/lib/registry/tools/regshell.c')
-rw-r--r--source4/lib/registry/tools/regshell.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index fb7a08e38f..208b19fba8 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -226,13 +226,7 @@ static WERROR cmd_ls(struct regshell_context *ctx, int argc, char **argv)
return error;
}
- /* default value */
- if (W_ERROR_IS_OK(reg_key_get_value_by_index(ctx, ctx->current, 0,
- &name, &valuetype, &valuedata)))
- printf("V \"(Default)\" %s %s\n", str_regtype(valuetype),
- reg_val_data_string(ctx, lp_iconv_convenience(cmdline_lp_ctx), valuetype, valuedata));
- /* other values */
- for (i = 1; W_ERROR_IS_OK(error = reg_key_get_value_by_index(ctx,
+ for (i = 0; W_ERROR_IS_OK(error = reg_key_get_value_by_index(ctx,
ctx->current, i, &name, &valuetype, &valuedata)); i++)
printf("V \"%s\" %s %s\n", name, str_regtype(valuetype),
reg_val_data_string(ctx, lp_iconv_convenience(cmdline_lp_ctx), valuetype, valuedata));
@@ -440,7 +434,7 @@ static char **reg_complete_key(const char *text, int start, int end)
len = strlen(text);
for(i = 0; j < MAX_COMPLETIONS-1; i++) {
status = reg_key_get_subkey_by_index(mem_ctx, base, i,
- &subkeyname, NULL, NULL);
+ &subkeyname, NULL, NULL);
if(W_ERROR_IS_OK(status)) {
if(!strncmp(text, subkeyname, len)) {
matches[j] = strdup(subkeyname);
@@ -538,7 +532,8 @@ int main(int argc, char **argv)
if (ctx->current == NULL) {
int i;
- for (i = 0; reg_predefined_keys[i].handle; i++) {
+ for (i = 0; (reg_predefined_keys[i].handle != 0) &&
+ (ctx->current == NULL); i++) {
WERROR err;
err = reg_get_predefined_key(ctx->registry,
reg_predefined_keys[i].handle,