Skip to content

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Apr 28, 2023

When comparing two paths from different drives like:

a := paths.New(`C:\AAA\BBB`)
b := paths.New(`D:\AAA\BBB\CCC`)
fmt.Println(b.IsInsideDir(a))

the function IsInsideDir returns an error instead of the correct result false.
See arduino/arduino-cli#2156 for a real-world use case.

@cmaglie cmaglie self-assigned this Apr 28, 2023
@cmaglie cmaglie added type: bug Perceived defect in any part of project priority: high Resolution is a high priority topic: code Related to content of the project itself labels Apr 28, 2023
@cmaglie cmaglie merged commit aa361d8 into master Apr 28, 2023
@cmaglie cmaglie deleted the fix_isinsidedir branch April 28, 2023 15:25
@per1234 per1234 changed the title Fix Pahts.IsInsideDir method when paths belongs to different drives/filesystem Fix Paths.IsInsideDir method when paths belongs to different drives/filesystem Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high Resolution is a high priority topic: code Related to content of the project itself type: bug Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants