ResourceFile: Don't rely on finder info being set, even on Macs

This commit is contained in:
Wolfgang Thaller 2015-09-14 23:06:21 +02:00
parent 54591b457a
commit 64e7a15755

View File

@ -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