Skip to content

Commit

Permalink
[Core] Fixed issue with drive1: not being initialised correctly from …
Browse files Browse the repository at this point in the history
…the File class.
  • Loading branch information
paul-manias committed Jan 6, 2025
1 parent d189f82 commit 4186f0e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/classes/class_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,11 @@ static ERR FILE_Init(extFile *Self)
#ifdef __unix__
// Establishing whether or not the path is a link is required on initialisation.
struct stat64 info;
if (Self->prvResolvedPath.ends_with('/')) Self->prvResolvedPath.pop_back(); // For lstat64() symlink we need to remove the slash
if (lstat64(Self->prvResolvedPath.c_str(), &info) != -1) { // Prefer to get a stat on the link rather than the file it refers to
if (S_ISLNK(info.st_mode)) Self->Flags |= FL::LINK;
if (Self->prvResolvedPath != "/") {
if (Self->prvResolvedPath.ends_with('/')) Self->prvResolvedPath.pop_back(); // For lstat64() symlink we need to remove the slash
if (lstat64(Self->prvResolvedPath.c_str(), &info) != -1) { // Prefer to get a stat on the link rather than the file it refers to
if (S_ISLNK(info.st_mode)) Self->Flags |= FL::LINK;
}
}
#endif

Expand Down

0 comments on commit 4186f0e

Please sign in to comment.