relative_path should honor dos-drive-prefix
authorJiang Xin <redacted>
Mon, 14 Oct 2013 02:29:39 +0000 (10:29 +0800)
committerJonathan Nieder <redacted>
Mon, 14 Oct 2013 14:00:26 +0000 (07:00 -0700)
commit7fbd422162f2b49bc06a29a063f519450165dc86
tree206305e4a38d3e6858d89f7d11dfb48fb0b082c0
parentdaf19a80fa6b7402f8a2efa8f8255b4b5d6b48a9
relative_path should honor dos-drive-prefix

Tvangeste found that the "relative_path" function could not work
properly on Windows if "in" and "prefix" have DOS drive prefix
(such as "C:/windows"). ($gmane/234434)

E.g., When execute: test-path-utils relative_path "C:/a/b" "D:/x/y",
should return "C:/a/b", but returns "../../C:/a/b", which is wrong.

So make relative_path honor DOS drive prefix, and add test cases
for it in t0060.

Reported-by: Tvangeste <redacted>
Helped-by: Johannes Sixt <redacted>
Signed-off-by: Jiang Xin <redacted>
Signed-off-by: Jonathan Nieder <redacted>
path.c
t/t0060-path-utils.sh
git clone https://git.99rst.org/PROJECT