fix(path): ignore empty root in full path

resolves #2962
This commit is contained in:
Jan De Dobbeleer 2022-12-07 06:37:36 +01:00 committed by Jan De Dobbeleer
parent a86ab4f525
commit fc80a8e11d

View file

@ -375,7 +375,7 @@ func (pt *Path) getAgnosterShortPath() string {
func (pt *Path) getFullPath() string {
rel := pt.relative
pathSeparator := pt.env.PathSeparator()
if pt.root != pathSeparator && !strings.HasSuffix(pt.root, pathSeparator) {
if len(pt.root) != 0 && pt.root != pathSeparator && !strings.HasSuffix(pt.root, pathSeparator) {
rel = pathSeparator + rel
}
path := pt.replaceFolderSeparators(rel)