[PATCH] Add get_current_dir_name(3)

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Sun Jan 1 16:07:00 GMT 2012


On Sun, Jan 01, 2012 at 01:13:25AM -0600, Yaakov (Cygwin/X) wrote:
>On Sun, 2012-01-01 at 01:46 -0500, Christopher Faylor wrote:
>> On Sat, Dec 31, 2011 at 08:45:07PM -0600, Yaakov (Cygwin/X) wrote:
>> >+extern "C" char *
>> >+get_current_dir_name (void)
>> >+{
>> >+  char *pwd = getenv ("PWD");
>> >+  char *cwd = getcwd (NULL, 0);
>> >+
>> >+  if (pwd)
>> >+    {
>> >+      struct __stat64 pwdbuf, cwdbuf;
>> >+      stat64 (pwd, &pwdbuf);
>> >+      stat64 (cwd, &cwdbuf);
>> >+      if (pwdbuf.st_ino == cwdbuf.st_ino)
>> 
>> You have to check st_dev here too don't you?
>
>Of course.  Revised patch for winsup/cygwin attached.

Looks good.  The Cygwin part is approved.

Thanks.

cgf



More information about the Cygwin-patches mailing list