Index: utils/regtool.cc =================================================================== RCS file: /cvs/src/src/winsup/utils/regtool.cc,v retrieving revision 1.10 diff -u -p -2 -r1.10 regtool.cc --- utils/regtool.cc 7 Jun 2002 11:12:16 -0000 1.10 +++ utils/regtool.cc 7 Aug 2002 16:53:46 -0000 @@ -15,4 +15,6 @@ details. */ #include +#define DEFAULT_KEY_SEPARATOR '\\' + enum { @@ -20,4 +22,6 @@ enum } key_type = KT_AUTO; +char key_sep = DEFAULT_KEY_SEPARATOR; + #define LIST_KEYS 0x01 #define LIST_VALS 0x02 @@ -40,8 +44,9 @@ static struct option longopts[] = {"verbose", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, + {"key-separator", required_argument, NULL, 'K'}, {NULL, 0, NULL, 0} }; -static char opts[] = "ehiklmpqsvV"; +static char opts[] = "ehiklmpqsvVK::"; int listwhat = 0; @@ -84,4 +89,7 @@ usage (FILE *where = stderr) " -s, --string set type to REG_SZ\n" "\n" + "Options for 'set' and 'unset' Actions:\n" + " -K, --key-separator[=] set key separator to instead of '\\'\n" + "\n" "Other Options:\n" " -h, --help output usage information and exit\n" @@ -309,7 +317,7 @@ find_key (int howmanyparts, REGSAM acces if (howmanyparts > 1) { - while (n < e && *e != '\\') + while (n < e && *e != key_sep) e--; - if (*e != '\\') + if (*e != key_sep) { key = wkprefixes[i].key; @@ -662,4 +670,7 @@ main (int argc, char **_argv) print_version (); exit (0); + case 'K': + key_sep = *optarg; + break; default : usage ();