@@ -604,35 +604,38 @@ replaceDirectory x dir = combineAlways dir (takeFileName x)
604
604
605
605
606
606
-- | Combine two paths, if the second path starts with a path separator or a
607
- -- drive letter, then it returns the second.
607
+ -- drive letter, then it returns the second.
608
608
--
609
609
-- > Valid x => combine (takeDirectory x) (takeFileName x) `equalFilePath` x
610
610
--
611
- -- Combined:
611
+ -- Combined:
612
+ --
612
613
-- > Posix: combine "/" "test" == "/test"
613
614
-- > Posix: combine "home" "bob" == "home/bob"
614
615
-- > Posix: combine "x:" "foo" == "x:/foo"
615
616
-- > Windows: combine "C:\\foo" "bar" == "C:\\foo\\bar"
616
617
-- > Windows: combine "home" "bob" == "home\\bob"
617
618
--
618
- -- Not combined:
619
+ -- Not combined:
620
+ --
619
621
-- > Posix: combine "home" "/bob" == "/bob"
620
622
-- > Windows: combine "home" "C:\\bob" == "C:\\bob"
621
623
--
622
- -- Not combined (tricky):
623
- -- On Windows, if a filepath starts with a single slash, it is relative to the
624
- -- root of the current drive. In [1], this is (confusingly) referred to as an
625
- -- absolute path.
626
- -- The current behavior of @combine@ is to never combine these forms.
624
+ -- Not combined (tricky):
625
+ --
626
+ -- On Windows, if a filepath starts with a single slash, it is relative to the
627
+ -- root of the current drive. In [1], this is (confusingly) referred to as an
628
+ -- absolute path.
629
+ -- The current behavior of @combine@ is to never combine these forms.
627
630
--
628
631
-- > Windows: combine "home" "/bob" == "/bob"
629
632
-- > Windows: combine "home" "\\bob" == "\\bob"
630
633
-- > Windows: combine "C:\\home" "\\bob" == "\\bob"
631
634
--
632
- -- On Windows, from [1]: "If a file name begins with only a disk designator
633
- -- but not the backslash after the colon, it is interpreted as a relative path
634
- -- to the current directory on the drive with the specified letter."
635
- -- The current behavior of @combine@ is to never combine these forms.
635
+ -- On Windows, from [1]: "If a file name begins with only a disk designator
636
+ -- but not the backslash after the colon, it is interpreted as a relative path
637
+ -- to the current directory on the drive with the specified letter."
638
+ -- The current behavior of @combine@ is to never combine these forms.
636
639
--
637
640
-- > Windows: combine "D:\\foo" "C:bar" == "C:bar"
638
641
-- > Windows: combine "C:\\foo" "C:bar" == "C:bar"
0 commit comments