-
Notifications
You must be signed in to change notification settings - Fork 743
Fix UFO features.fea relative include path implementation #4631
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
Conversation
62dee78
to
ab29ecc
Compare
@ctrlcctrlv should we pick this back up again? |
Yes, we should. Apologies for long delay. |
9994061
to
2b31642
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sorry to bug you @jtanx, but this is impeding my work. I know it's mostly my fault it's sat so long, but hopefully there have been enough rounds of review? :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, one more but I think that's it
fontforge/featurefile.c
Outdated
filename, tok->line[tok->inc_depth], tok->filename[tok->inc_depth] ); | ||
++tok->err_count; | ||
free(filename); | ||
in_deprecated = fopen(filename_deprecated, "r"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this leaks filename
and filename_deprecated
in the opposite case. I think you can also get away without having in_deprecated
. Maybe:
in = fopen(filename, "r");
if (in == NULL) {
if (filename != filename_deprecated) {
free(filename);
filename = filename_deprecated;
in = fopen(filename, "r");
}
if (in == NULL) {
LogError(...cantopen...);
++tok->err_count;
free(filename);
return;
}
LogError(...deprecated...);
} else if (filename != filename_deprecated) {
free(filename_deprecated);
}
We're including the wrong path when the features.fea include path is relative. It's supposed to be relative to the directory the UFO is in, not relative to features.fea. I fixed this by following @skef's advice of checking the correct directory first, and if it fails, then trying the deprecated directory, and emitting a warning. Close fontforge#4629
We're including the wrong path when the features.fea include path is
relative. It's supposed to be relative to the directory the UFO is in,
not relative to features.fea.
I fixed this by following @skef's advice of checking the correct
directory first, and if it fails, then trying the deprecated directory,
and emitting a warning.
Close #4629
Type of change