-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
FileUtil::relativize doesn't take symlinks into account #12995
Copy link
Copy link
Labels
component: external-filesgood second issueIssues that involve a tour of two or three interweaved components in JabRefIssues that involve a tour of two or three interweaved components in JabRef📌 Pinned📍 AssignedAssigned by assign-issue-action (or manually assigned)Assigned by assign-issue-action (or manually assigned)
Metadata
Metadata
Assignees
Labels
component: external-filesgood second issueIssues that involve a tour of two or three interweaved components in JabRefIssues that involve a tour of two or three interweaved components in JabRef📌 Pinned📍 AssignedAssigned by assign-issue-action (or manually assigned)Assigned by assign-issue-action (or manually assigned)
Type
Fields
Give feedbackNo fields configured for bug.
Projects
StatusShow more project fields
Done
StatusShow more project fields
Done
JabRef version
5.15 (latest release)
Operating system
GNU / Linux
Details on version and operating system
KDE Neon - based on Ubuntu 24.04
Checked with the latest development build (copy version output from About dialog)
Steps to reproduce the behaviour
Look at
jabref/src/main/java/org/jabref/logic/util/io/FileUtil.java
Lines 261 to 263 in af362ea
Appendix
The effect of this is (among other things?) that when manually linking a PDF file to a bib entry, which is located in the main file directory, it can still end up being added by its full path.
This is because the configured main file directory and/or the path to the selected PDF file can contain symbolic links which make the paths appear different (which causes
FileUtils::relativizeto fail) even though they are not.It seems that
Path::toRealPathfrom Java's standard library could be used for obtaining a canonical path representation that has symlinks resolved.