Paul Smith wrote:
Thanks for this patch, Paul.

One question:

On Sun, 2017-09-10 at 09:40 -0700, Paul Eggert wrote:
+  /* Make sure the parent of "." exists and is a directory, not a
+     file.  This is because 'lstat' on Windows normalizes the argument
+     foo/. => foo without checking first that foo is a directory.  */
+  if (plen > 1 && path[plen - 1] == '.'
+      && (path[plen - 2] == '/' || path[plen - 2] == '\\'))
+    {
+      char parent[MAXPATHLEN];
+
+      strncpy (parent, path, plen - 2);

If it's true that Windows normalizes the argument, why do we need to
make a copy of the prefix of path?  Wouldn't we get the same behavior if
we sent the original path string to lstat(), and just tested ISDIR
afterwards?


Yes, that sounds right. I copied that boilerplate from local_stat, so local_stat could be simplified too.

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to