Mail Archives: cygwin-developers/2000/01/20/05:14:25
Hi DJ,
I have made a small patch to your new regtool. It's a nice tool
but personally I hate using backslashes on the command line.
My patch checks the first char of the key value to be a slash.
If so, all slashes are translated to backslashes if they
are not preceded by a backslash itself.
I have done the check for the first char is a slash to avoid
some fuzzy kind of automatism.
If you don't like this patch, simply ignore it :)
Bye,
Corinna
========== SNIP ===========
Index: regtool.cc
===================================================================
RCS file: /src/cvsroot/winsup-000108/utils/regtool.cc,v
retrieving revision 1.1
diff -u -p -r1.1 regtool.cc
--- regtool.cc 2000/01/20 09:36:29 1.1
+++ regtool.cc 2000/01/20 09:35:52
@@ -92,11 +92,23 @@ struct {
{ 0, 0 }
};
+void translate(char *key)
+{
+ char *c = key;
+ while (c = strchr (c, '/'))
+ if (c > key && c[-1] == '\\')
+ memmove(c-1, c, strlen(c)+1);
+ else
+ *c++ = '\\';
+}
+
void
find_key(int howmanyparts)
{
char *n = argv[0], *e, c;
int i;
+ if (*n == '/')
+ translate(n);
while (*n == '\\')
n++;
for (e=n; *e && *e != '\\'; e++);
- Raw text -