ply-utils: Use lstat instead of stat for ply_file_exists

If a file is a symlink, we usually want to follow it, so
testing the symlink itself, is less than optimal.

This commit switches to lstat instead of stat.
This commit is contained in:
Ray Strode 2023-12-28 12:10:57 -05:00 committed by Ray Strode
parent 746078e89d
commit e989867f48

View file

@ -518,7 +518,7 @@ ply_file_exists (const char *file)
{
struct stat file_info;
if (stat (file, &file_info) < 0)
if (lstat (file, &file_info) < 0)
return false;
return S_ISREG (file_info.st_mode);