mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-26 06:49:33 +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);
|
fs::path path(pathstring);
|
||||||
|
|
||||||
|
type = creator = 0x3F3F3F3F;
|
||||||
|
|
||||||
switch(format)
|
switch(format)
|
||||||
{
|
{
|
||||||
case Format::basilisk:
|
case Format::basilisk:
|
||||||
@ -200,10 +202,12 @@ bool ResourceFile::read()
|
|||||||
char finf[32];
|
char finf[32];
|
||||||
int n = getxattr(path.c_str(), XATTR_FINDERINFO_NAME,
|
int n = getxattr(path.c_str(), XATTR_FINDERINFO_NAME,
|
||||||
finf, 32, 0, 0);
|
finf, 32, 0, 0);
|
||||||
|
if(n > 0)
|
||||||
std::istringstream finfIn(std::string(finf, finf+n));
|
{
|
||||||
type = ostype(finfIn);
|
std::istringstream finfIn(std::string(finf, finf+n));
|
||||||
creator = ostype(finfIn);
|
type = ostype(finfIn);
|
||||||
|
creator = ostype(finfIn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user