From 60801e810503a89ba1253e3e0b688a33f7465182 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sun, 20 Apr 2003 21:52:55 +0000 Subject: [PATCH] Add a -f command-line flag to specify printing all paths or only terminal paths. (This used to be commit 0741369c59bcb6057f6b32d3fe4f6dec08ce4ae3) --- source3/utils/editreg.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source3/utils/editreg.c b/source3/utils/editreg.c index b35e278ab05..1b148f3bd16 100644 --- a/source3/utils/editreg.c +++ b/source3/utils/editreg.c @@ -330,6 +330,7 @@ Hope this helps.... (Although it was "fun" for me to uncover this things, static int verbose = 0; static int print_security = 0; +static int full_print = 0; /* * These definitions are for the in-memory registry structure. @@ -2990,7 +2991,7 @@ int print_key(const char *path, char *name, char *class_name, int root, int terminal, int vals) { - /*if (terminal)*/ fprintf(stdout, "[%s%s]\n", path, name); + if (full_print || terminal) fprintf(stdout, "[%s%s]\n", path, name); return 1; } @@ -3142,9 +3143,10 @@ int print_val(const char *path, char *val_name, int val_type, int data_len, void usage(void) { - fprintf(stderr, "Usage: editreg [-v] [-p] [-k] [-s] [-c ] \n"); + fprintf(stderr, "Usage: editreg [-f] [-v] [-p] [-k] [-s] [-c ] \n"); fprintf(stderr, "Version: 0.1\n\n"); fprintf(stderr, "\n\t-v\t sets verbose mode"); + fprintf(stderr, "\n\t-f\t sets full print mode where non-terminals are printed"); fprintf(stderr, "\n\t-p\t prints the registry"); fprintf(stderr, "\n\t-s\t prints security descriptors"); fprintf(stderr, "\n\t-c \t specifies a command file"); @@ -3172,7 +3174,7 @@ int main(int argc, char *argv[]) * Now, process the arguments */ - while ((opt = getopt(argc, argv, "spvko:c:")) != EOF) { + while ((opt = getopt(argc, argv, "fspvko:c:")) != EOF) { switch (opt) { case 'c': commands = 1; @@ -3180,6 +3182,11 @@ int main(int argc, char *argv[]) regf_opt += 2; break; + case 'f': + full_print = 1; + regf_opt++; + break; + case 'o': out_file_name = optarg; regf_opt += 2; @@ -3192,6 +3199,7 @@ int main(int argc, char *argv[]) case 's': print_security++; + full_print++; regf_opt++; break; -- 2.11.4.GIT