Skip to content

fsys: resolve symlinks on Unix platforms #4626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

liushuyu
Copy link

@liushuyu liushuyu commented Feb 10, 2021

This will make fontforge resolve the symbolic links on the Unix platforms when loading its assets.

This resolves the issue where if fontforge is invoked through symlink, it will not be able to load the resources.

Type of change

  • Non-breaking change

This change is Reviewable

Copy link
Contributor

@skef skef left a comment

Choose a reason for hiding this comment

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

This seems fine to me. Anyone else have concerns?

@jtanx
Copy link
Contributor

jtanx commented Feb 10, 2021

Can you explain a full example? imo if you want to resolve symlinks this should be done on the path to the fontforge binary itself instead of the folder containing fontforge (like there is a potential difference resolving /a/b/c vs /a/b/c/fontforge).

@liushuyu
Copy link
Author

Can you explain a full example? imo if you want to resolve symlinks this should be done on the path to the fontforge binary itself instead of the folder containing fontforge (like there is a potential difference resolving /a/b/c vs /a/b/c/fontforge).

This could happen in many Linux distro where /bin/ is a symlink to /usr/bin. The fontforge will look for resource files in /share in this case, which is incorrect. This fix will hopefully resolve such issue.

Regarding your concern with the path resolution, I will change my patch to resolve the path to the binary.

@jtanx
Copy link
Contributor

jtanx commented Feb 12, 2021

Which distro is this? Sounds more like a problem that if you symlink /bin to /usr/bin, then so too should /share to /usr/share

Comment on lines +556 to +559
if ( (buf = realpath(program_dir, NULL)) ) {
free(program_dir);
program_dir = buf;
}
Copy link
Member

Choose a reason for hiding this comment

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

The whitespace is misaligned.

@frank-trampe
Copy link
Contributor

@liushuyu, just pinging regarding what @jtanx said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants