diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-12-16 12:49:48 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-12-16 12:49:48 -0800 |
commit | 20cb8e202520173727f3ea060e1eca035b32e2b7 (patch) | |
tree | 0f7b8b7168c108c9cfb09793fa06db5c49c9883e /dir.c | |
parent | b720c75afde3d813588fdfc84f762ef947f5587a (diff) | |
parent | fbbb4e19bee8c4d62f274f9e07b91c45e4df838c (diff) | |
download | git-20cb8e202520173727f3ea060e1eca035b32e2b7.tar.gz git-20cb8e202520173727f3ea060e1eca035b32e2b7.tar.xz |
Merge branch 'nd/maint-relative'
* nd/maint-relative:
get_cwd_relative(): do not misinterpret root path
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1033,6 +1033,12 @@ char *get_relative_cwd(char *buffer, int size, const char *dir) case '/': return cwd + 1; default: + /* + * dir can end with a path separator when it's root + * directory. Return proper prefix in that case. + */ + if (dir[-1] == '/') + return cwd; return NULL; } } |