fix(library/init/lean/path): user normalizePathSeparators at moduleNameOfFileName

This commit is contained in:
Leonardo de Moura 2019-07-28 10:09:51 -07:00
parent 17e5f0b719
commit 1d0d65893b

View file

@ -106,7 +106,7 @@ do fname ← IO.realPath (System.FilePath.normalizePathSeparators fname);
def moduleNameOfFileName (fname : String) : IO Name :=
do
path ← findAtSearchPath fname;
fname ← IO.realPath fname;
fname ← IO.realPath (System.FilePath.normalizePathSeparators fname);
let fnameSuffix := fname.drop path.length;
let fnameSuffix := if fnameSuffix.get 0 == pathSeparator then fnameSuffix.drop 1 else fnameSuffix;
if path ++ pathSep ++ fnameSuffix != fname then