mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-27 23:31:44 +00:00
ResourceFile: Don't rely on finder info being set, even on Macs
This commit is contained in:
parent
54591b457a
commit
64e7a15755
@ -173,6 +173,8 @@ bool ResourceFile::read()
|
||||
{
|
||||
fs::path path(pathstring);
|
||||
|
||||
type = creator = 0x3F3F3F3F;
|
||||
|
||||
switch(format)
|
||||
{
|
||||
case Format::basilisk:
|
||||
@ -200,10 +202,12 @@ bool ResourceFile::read()
|
||||
char finf[32];
|
||||
int n = getxattr(path.c_str(), XATTR_FINDERINFO_NAME,
|
||||
finf, 32, 0, 0);
|
||||
|
||||
std::istringstream finfIn(std::string(finf, finf+n));
|
||||
type = ostype(finfIn);
|
||||
creator = ostype(finfIn);
|
||||
if(n > 0)
|
||||
{
|
||||
std::istringstream finfIn(std::string(finf, finf+n));
|
||||
type = ostype(finfIn);
|
||||
creator = ostype(finfIn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user