]> sourceware.org Git - newlib-cygwin.git/commitdiff
2005-01-26 Pierre Humblet <pierre.humblet@ieee.org>
authorPierre Humblet <phumblet@phumblet.no-ip.org>
Wed, 26 Jan 2005 04:34:19 +0000 (04:34 +0000)
committerPierre Humblet <phumblet@phumblet.no-ip.org>
Wed, 26 Jan 2005 04:34:19 +0000 (04:34 +0000)
* path.cc (path_conv::check): Return ENOTDIR rather than ENOENT
when a component is not a directory. Remove unreachable code.
(digits): Delete.

winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index 06751a193ad00b0c8a5d6f6e5969f3405a6d63f7..db63828a444cfeba0ec81fea50c7a2a5a7b8fe0c 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-26  Pierre Humblet <pierre.humblet@ieee.org>
+
+       * path.cc (path_conv::check): Return ENOTDIR rather than ENOENT
+       when a component is not a directory. Remove unreachable code.
+       (digits): Delete.
+
 2005-01-25  Christopher Faylor  <cgf@timesys.com>
 
        * pinfo.h (pinfo::init): Make third parameter non-optional and
index c636fb547a7175b4aa227da0ea69a3cc9917b805..a9d6292d7b422b1bbe4164b93a52af39cef39796 100644 (file)
@@ -655,12 +655,6 @@ path_conv::check (const char *src, unsigned opt,
              full_path[3] = '\0';
            }
 
-         if ((opt & PC_SYM_IGNORE) && pcheck_case == PCHECK_RELAXED)
-           {
-             fileattr = GetFileAttributes (this->path);
-             goto out;
-           }
-
          symlen = sym.check (full_path, suff, opt | fs.has_ea ());
 
          if (sym.minor || sym.major)
@@ -706,6 +700,11 @@ path_conv::check (const char *src, unsigned opt,
                  error = sym.error;
                  if (component == 0)
                    add_ext_from_sym (sym);
+                  else if (!(sym.fileattr & FILE_ATTRIBUTE_DIRECTORY))
+                    {
+                      error = ENOTDIR;
+                     goto out;
+                    }  
                  if (pcheck_case == PCHECK_RELAXED)
                    goto out;   // file found
                  /* Avoid further symlink evaluation. Only case checks are
@@ -939,15 +938,6 @@ path_conv::~path_conv ()
     }
 }
 
-static __inline int
-digits (const char *name)
-{
-  char *p;
-  int n = strtol (name, &p, 10);
-
-  return p > name && !*p ? n : -1;
-}
-
 /* Return true if src_path is a valid, internally supported device name.
    In that case, win32_path gets the corresponding NT device name and
    dev is appropriately filled with device information. */
This page took 0.034103 seconds and 5 git commands to generate.