Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ee/gs/src/gsFontM.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ int gsKit_fontm_unpack(GSFONTM *gsFontM)
if(FontMFile < 0)
{
printf("Failed to open FONTM from ROM0\n");
return -1;
FontMFile = open("rom0:FONTM", O_RDONLY);
if(FontMFile < 0)
{
FontMFile = open("mc0:FONTM", O_RDONLY);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to use a relative path?

Just saying

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not safe to rely on CWD inside library as current working dir can randomly change during library use but call to the FONTM should remain intact.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But do you close and open the file? If the file is left opened, changes to CWD in libc later on during runtime should not matter.

Personally, I feel that it should be the software engineer's responsibility that the files are accessible where it matters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, totally forgot about closing

return -1;
}
}

PackedSize = lseek(FontMFile, 0, SEEK_END);
Expand Down
Loading