mirror of
https://github.com/yarlson/lnk.git
synced 2025-09-02 18:12:33 +02:00
fix(core): remove unnecessary Windows drive letter check in getRelativePath
This commit is contained in:
@@ -69,9 +69,6 @@ func getRelativePath(absPath string) (string, error) {
|
|||||||
if strings.HasPrefix(relPath, "..") {
|
if strings.HasPrefix(relPath, "..") {
|
||||||
// Use absolute path but remove leading slash and drive letter (for cross-platform)
|
// Use absolute path but remove leading slash and drive letter (for cross-platform)
|
||||||
cleanPath := strings.TrimPrefix(absPath, "/")
|
cleanPath := strings.TrimPrefix(absPath, "/")
|
||||||
if len(cleanPath) > 1 && cleanPath[1] == ':' {
|
|
||||||
// Windows drive letter, keep as is
|
|
||||||
}
|
|
||||||
return cleanPath, nil
|
return cleanPath, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user