[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Do not assume glibc glob internals
From: |
Paul Smith |
Subject: |
Re: [PATCH] Do not assume glibc glob internals |
Date: |
Sat, 23 Sep 2017 17:09:00 -0400 |
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?
- [PATCH] Do not assume glibc glob internals, Paul Eggert, 2017/09/10
- Re: [PATCH] Do not assume glibc glob internals,
Paul Smith <=
- Re: [PATCH] Do not assume glibc glob internals, Paul Eggert, 2017/09/24
- Re: [PATCH] Do not assume glibc glob internals, Paul Eggert, 2017/09/24
- Re: [PATCH] Do not assume glibc glob internals, Paul Smith, 2017/09/24
- Re: [PATCH] Do not assume glibc glob internals, Paul Eggert, 2017/09/24
- Re: [PATCH] Do not assume glibc glob internals, Paul Smith, 2017/09/25
- Re: [PATCH] Do not assume glibc glob internals, Eli Zaretskii, 2017/09/29
- Re: [PATCH] Do not assume glibc glob internals, Paul Eggert, 2017/09/29