delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/08/06/09:45:04

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <C2D7D58DBFE9D111B0480060086E963504AC521E@mail.gft.de>
From: "Schaible, Jorg" <Joerg DOT Schaible AT gft DOT com>
To: cygwin AT sources DOT redhat DOT com
Cc: cygwin-patches AT sources DOT redhat DOT com
Subject: RE: check_case:strict / cygpath
Date: Mon, 6 Aug 2001 15:40:01 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

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 <joerg DOT schaible AT gmx DOT de>

	* 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:haase AT convey DOT de]
>Sent: Thursday, August 02, 2001 7:29 PM
>To: cygwin AT sources DOT redhat DOT com
>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
>
>
>-- 
>gerrit DOT haase AT convey DOT de
>
>--
>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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019