File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -648,13 +648,16 @@ splitFileName_ fp
648648 -- If bs' is empty, then s2 as the last character of dirSlash must be a path separator,
649649 -- so we are in the middle of shared drive.
650650 -- Otherwise, since s1 is a path separator, we might be in the middle of UNC path.
651- , null bs' || maybe False ( null . snd ) (readDriveUNC dirSlash)
651+ , null bs' || maybe False isIncompleteUNC (readDriveUNC dirSlash)
652652 = (fp, mempty )
653653 | otherwise
654654 = (dirSlash, file)
655655 where
656656 (dirSlash, file) = breakEnd isPathSeparator fp
657657
658+ isIncompleteUNC (pref, suff) = null suff && not (hasPenultimateColon pref)
659+ hasPenultimateColon = maybe False (maybe False ((== _colon) . snd ) . unsnoc . fst ) . unsnoc
660+
658661-- | Set the filename.
659662--
660663-- > replaceFileName "/directory/other.txt" "file.ext" == "/directory/file.ext"
You can’t perform that action at this time.
0 commit comments