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
648
648
-- If bs' is empty, then s2 as the last character of dirSlash must be a path separator,
649
649
-- so we are in the middle of shared drive.
650
650
-- 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)
652
652
= (fp, mempty )
653
653
| otherwise
654
654
= (dirSlash, file)
655
655
where
656
656
(dirSlash, file) = breakEnd isPathSeparator fp
657
657
658
+ isIncompleteUNC (pref, suff) = null suff && not (hasPenultimateColon pref)
659
+ hasPenultimateColon = maybe False (maybe False ((== _colon) . snd ) . unsnoc . fst ) . unsnoc
660
+
658
661
-- | Set the filename.
659
662
--
660
663
-- > replaceFileName "/directory/other.txt" "file.ext" == "/directory/file.ext"
You can’t perform that action at this time.
0 commit comments