]> sourceware.org Git - newlib-cygwin.git/commitdiff
* utils/cygpath.cc (get_long_path_name_w32impl): Close handles returned by
authorChristopher Faylor <me@cgf.cx>
Sat, 31 Mar 2007 00:03:25 +0000 (00:03 +0000)
committerChristopher Faylor <me@cgf.cx>
Sat, 31 Mar 2007 00:03:25 +0000 (00:03 +0000)
FindFirstFile.

winsup/utils/ChangeLog
winsup/utils/cygpath.cc

index 8407fb304c66fdcd0d309c8a7a3daf4f00c6776b..c690337e110944622840baea0e99b307f45e8f20 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-30  Mark Mitchell  <mark@codesourcery.com>
+
+       * utils/cygpath.cc (get_long_path_name_w32impl): Close handles returned
+       by FindFirstFile.
+
 2007-03-30  Christopher Faylor  <me@cgf.cx>
 
        * mount.cc (main): Turn dos file warnings off since we know what we're
index 9e4392f8011160709a8f68ccb208ff2fdc60b7c2..45fc9b405fc524f366bef279f3fcf63b1ea98517 100644 (file)
@@ -1,5 +1,6 @@
 /* cygpath.cc -- convert pathnames between Windows and Unix format
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2006, 2007 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -375,8 +376,13 @@ get_long_path_name_w32impl (LPCSTR src, LPSTR sbuf, DWORD)
       ptr[len] = 0;
       if (next[1] != ':' && strcmp(next, ".") && strcmp(next, ".."))
        {
-         if (FindFirstFile (buf2, &w32_fd) != INVALID_HANDLE_VALUE)
+         HANDLE h;
+         h = FindFirstFile (buf2, &w32_fd);
+         if (h != INVALID_HANDLE_VALUE)
+           {
            strcpy (ptr, w32_fd.cFileName);
+             FindClose (h);
+           }
        }
       ptr += strlen (ptr);
       if (pelem)
@@ -415,7 +421,7 @@ get_long_name (const char *filename, DWORD& len)
       else if (err == ERROR_FILE_NOT_FOUND)
        len = get_long_path_name_w32impl (filename, buf, MAX_PATH);
       else
-        {
+       {
          buf[0] = '\0';
          strncat (buf, filename, MAX_PATH - 1);
          len = strlen (buf);
@@ -561,7 +567,7 @@ dowin (char option)
                     prog_name, output_arg);
            exit (1);
          }
-        get_special_folder (buf, val);
+       get_special_folder (buf, val);
       }
       break;
 
This page took 0.037873 seconds and 5 git commands to generate.