-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sprite name generation so symlinks work
This addresses an issue creating valid sprite names for symlinks, as detailed in issue #81. Symlinked files were being canonicalised, which caused a problem if the target was outside the base path. This change replaces the canonicalisation step with `std::path::absolute()`, which doesn't resolve symlinks and so they remain within the base path. The change has two side-effects: - It allows sprite names to be generated for non-existent files (a good thing, since there's no need for names to be linked to the filesystem) - It modifies the `spreet::sprite_name()` function to return a `PathError` instead of an `IoError` when the `abs_path` argument is not an ancestor of the `path` argument. Use of `std::path::absolute()` means the minimum supported Rust version (MSRV) is now 1.74.
- Loading branch information
Showing
4 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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