On Fri, Feb 20, 2015 at 10:52:51PM +0100, Bram Moolenaar wrote:
>
> James McCoy wrote:
>
> > On Thu, Feb 19, 2015 at 08:38:02PM -0500, Charles E Campbell wrote:
> > > If after the ln -s file1 file2, one then types
> > > touch file1
> > > ls
> > > then both file1 and file2 appear. Glob("*") should in that case show
> > > file1
> > > and file2. There must be some information gathering that fails on the
> > > missing file1 that stops f_glob() from showing file2.
> >
> > Right. It's a difference in using stat(2) vs. lstat(2). The attached
> > patch uses lstat() instead of mch_getperm() to determine whether the
> > file should be considered.
>
> Somehow the attachment arrived empty.
Weird. Here it is again.
Cheers,
--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/misc1.c b/src/misc1.c
index 707abf8..4cd759c 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -10168,11 +10168,12 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
}
else
{
+ struct stat sb;
/* no more wildcards, check if there is a match */
/* remove backslashes for the remaining components only */
if (*path_end != NUL)
backslash_halve(buf + len + 1);
- if (mch_getperm(buf) >= 0) /* add existing file */
+ if (mch_lstat(buf, &sb) >= 0) /* add existing file */
{
#ifdef MACOS_CONVERT
size_t precomp_len = STRLEN(buf)+1;
@@ -10928,9 +10929,10 @@ addfile(gap, f, flags)
{
char_u *p;
int isdir;
+ struct stat sb;
/* if the file/dir doesn't exist, may not add it */
- if (!(flags & EW_NOTFOUND) && mch_getperm(f) < 0)
+ if (!(flags & EW_NOTFOUND) && mch_lstat(f, &sb) < 0)
return;
#ifdef FNAME_ILLEGAL