diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-11-20 13:50:51 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-23 16:15:16 -0800 |
commit | fbbb4e19bee8c4d62f274f9e07b91c45e4df838c (patch) | |
tree | 45b93776a21e219b0265d432bdeff21462be402e /t/t0004-unwritable.sh | |
parent | t0003: add missing && at end of lines (diff) | |
download | tgif-fbbb4e19bee8c4d62f274f9e07b91c45e4df838c.tar.xz |
get_cwd_relative(): do not misinterpret root path
Commit 490544b (get_cwd_relative(): do not misinterpret suffix as
subdirectory) handles case where:
dir = "/path/work";
cwd = "/path/work-xyz";
When it comes to the end of get_cwd_relative(), dir is at '\0' and cwd
is at '-'. The rest of cwd, "-xyz", clearly cannot be the relative
path from dir to cwd. However there is another case where:
dir = "/"; /* or even "c:/" */
cwd = "/path/to/here";
In this special case, while *cwd == 'p', which is not a path
separator, the rest of cwd, "path/to/here", can be returned as a
relative path from dir to cwd.
Handle this case and make t1509 pass again.
Reported-by: Albert Strasheim <fullung@gmail.com>
Reported-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0004-unwritable.sh')
0 files changed, 0 insertions, 0 deletions