In rebasePath, check for absolute paths two ways.
isAbsolute from FilePath doesn't return True on Windows for paths beginning with `/`, so we check that separately.
This commit is contained in:
parent
c210b98366
commit
0d7103de7e
1 changed files with 4 additions and 1 deletions
|
@ -1924,7 +1924,10 @@ rebasePath :: SourcePos -> Text -> Text
|
||||||
rebasePath pos path = do
|
rebasePath pos path = do
|
||||||
let fp = sourceName pos
|
let fp = sourceName pos
|
||||||
isFragment = T.take 1 path == "#"
|
isFragment = T.take 1 path == "#"
|
||||||
in if T.null path || isFragment || isAbsolute (T.unpack path) || isURI path
|
-- check for leading / because on Windows this won't be
|
||||||
|
-- recognized as absolute by isAbsolute
|
||||||
|
isAbsolutePath = isAbsolute (T.unpack path) || T.take 1 path == "/"
|
||||||
|
in if T.null path || isFragment || isAbsolutePath || isURI path
|
||||||
then path
|
then path
|
||||||
else
|
else
|
||||||
case takeDirectory fp of
|
case takeDirectory fp of
|
||||||
|
|
Loading…
Reference in a new issue