Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Message-ID: <3886E0DE.EE734589@vinschen.de> Date: Thu, 20 Jan 2000 11:18:06 +0100 From: Corinna Vinschen X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: de,en MIME-Version: 1.0 To: DJ Delorie CC: cygdev Subject: Suggestion for regtool Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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++);