Subject: RE: check_case:strict / cygpath
From: "Schaible, Jorg" <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Mon, 6 Aug 2001 15:40:01 +0200

Hi Gerrit,

it seems this is hard-coded by Windows (at least for my W2k). cygpath just
calls WIn-API GetSystemDirectory. I've provided a patch for this scenario.

Greetings,
Jorg

2001-08-06  Joerg Schaible <[email-masked]>

	* cygpath.cc (main): Support -w for Windows (System) directories and
	return physical correct orthography for the Windows System dir.

--- cygpath.cc-orig	Mon Aug  6 13:32:29 2001
+++ cygpath.cc	Mon Aug  6 13:24:11 2001
@@ -208,6 +208,7 @@ main (int argc, char **argv)
   int options_from_file_flag;
   char *filename;
   char buf[MAX_PATH], buf2[MAX_PATH];
+  WIN32_FIND_DATA w32_fd;
 
   prog_name = strrchr (argv[0], '/');
   if (prog_name == NULL)
@@ -266,13 +267,21 @@ main (int argc, char **argv)
 
 	case 'W':
 	  GetWindowsDirectory(buf, MAX_PATH);
-	  cygwin_conv_to_posix_path(buf, buf2);
+	  if (!windows_flag)
+	    cygwin_conv_to_posix_path(buf, buf2);
+	  else
+	    strcpy(buf2, buf);
 	  printf("%s\n", buf2);
 	  exit(0);
 
 	case 'S':
 	  GetSystemDirectory(buf, MAX_PATH);
-	  cygwin_conv_to_posix_path(buf, buf2);
+	  FindFirstFile(buf, &w32_fd);
+	  strcpy(strrchr(buf, '\\')+1, w32_fd.cFileName);
+	  if (!windows_flag)
+	    cygwin_conv_to_posix_path(buf, buf2);
+	  else
+	    strcpy(buf2, buf);
 	  printf("%s\n", buf2);
 	  exit(0);

>-----Original Message-----
>From: Gerrit P. Haase [mailto:[email-masked]]
>Sent: Thursday, August 02, 2001 7:29 PM
>To: [email-masked]
>Subject: check_case:strict / cygpath
>
>
>Hi, 
>
>cygpath reports the following to me:
>
>$ cygpath -u -S
>/cygdrive/c/WINNT/System32
>
>But my Sysdir is named not 'System32', but 'system32' .
>
>Is this a bug?
>
>gph
>
>
>-- 
>[email-masked]
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/