[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: |
Sun, 24 Sep 2017 15:12:17 -0400 |
On Sun, 2017-09-24 at 11:29 -0700, Paul Eggert wrote:
> 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...
I can't answer your question, but the previous version of this function
didn't do anything special with a "foo/" path, so if it doesn't work
here it didn't work there either...?
- [PATCH] Do not assume glibc glob internals, Paul Eggert, 2017/09/10
- Re: [PATCH] Do not assume glibc glob internals, Paul Smith, 2017/09/23
- 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 <=
- 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
- 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
- Re: [PATCH] Do not assume glibc glob internals, Eli Zaretskii, 2017/09/30