bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Do not assume glibc glob internals


From: Paul Eggert
Subject: Re: [PATCH] Do not assume glibc glob internals
Date: Sun, 24 Sep 2017 11:29:48 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

Paul Smith wrote:
+      size_t plen = strlen (path);
+
+      /* If path ends in /. make sure it is a directory.  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] == '\\')
+          && !_S_ISDIR (buf->st_mode))
+        return -1;

Isn't part of the problem that MS-Windows also mishandles names like "foo/" that end in "/" as opposed to ending in "/."? (I don't use MS-Windows so perhaps I should keep my mouth shut here, but still...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]