Fix UFO features.fea relative include path implementation#4631
Merged
ctrlcctrlv merged 1 commit intofontforge:masterfrom Jun 9, 2021
Merged
Fix UFO features.fea relative include path implementation#4631ctrlcctrlv merged 1 commit intofontforge:masterfrom
ctrlcctrlv merged 1 commit intofontforge:masterfrom
Conversation
62dee78 to
ab29ecc
Compare
skef
reviewed
Feb 24, 2021
Contributor
|
@ctrlcctrlv should we pick this back up again? |
Member
Author
|
Yes, we should. Apologies for long delay. |
jtanx
reviewed
Apr 27, 2021
9994061 to
2b31642
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jtanx
reviewed
Jun 6, 2021
Member
Author
|
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? :-) |
jtanx
reviewed
Jun 8, 2021
Contributor
jtanx
left a comment
There was a problem hiding this comment.
sorry, one more but I think that's it
| filename, tok->line[tok->inc_depth], tok->filename[tok->inc_depth] ); | ||
| ++tok->err_count; | ||
| free(filename); | ||
| in_deprecated = fopen(filename_deprecated, "r"); |
Contributor
There was a problem hiding this comment.
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
jtanx
approved these changes
Jun 9, 2021
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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