Changeset c9a6e18 in git for src/osdepend.c


Ignore:
Timestamp:
29/06/19 03:07:43 (4 months ago)
Author:
Olly Betts <olly@…>
Branches:
master
Children:
9fe70e44
Parents:
41cd172
git-author:
Olly Betts <olly@…> (29/06/19 03:06:19)
git-committer:
Olly Betts <olly@…> (29/06/19 03:07:43)
Message:

Dereference symlinks when testing for file/directory

The code was carefully using lstat() where available to try to do
this, but that's backwards - regular stat() dereferences a symlink
and lstat() doesn't!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/osdepend.c

    r41cd172 rc9a6e18  
    7272#endif
    7373       ) return 1;
    74 #ifdef HAVE_LSTAT
    75    /* On Unix, dereference any symlinks we might encounter */
    76    if (lstat(fnm, &buf) != 0) return 0;
    77 #else
    7874   if (stat(fnm, &buf) != 0) return 0;
    79 #endif
    8075#ifdef S_ISDIR
    8176   /* POSIX way */
Note: See TracChangeset for help on using the changeset viewer.