diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-05-28 16:59:42 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-28 16:59:42 -0700 |
commit | 81fa024cd8e336ba257f13fe7724b95baacfa3ad (patch) | |
tree | 69029df797195eb186535d82bbaadb8e7ed03712 /dir.c | |
parent | d0b16c8f878bef5c1268e033a3d1f427498c7008 (diff) | |
parent | 371276bf29314af04b804cfd877abcac62674a58 (diff) | |
download | git-81fa024cd8e336ba257f13fe7724b95baacfa3ad.tar.gz |
Merge branch 'maint'
* maint:
Makefile: reenable install with NO_CURL
completion: --set-upstream option for git-branch
get_cwd_relative(): do not misinterpret suffix as subdirectory
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -958,9 +958,14 @@ char *get_relative_cwd(char *buffer, int size, const char *dir) } if (*dir) return NULL; - if (*cwd == '/') + switch (*cwd) { + case '\0': + return cwd; + case '/': return cwd + 1; - return cwd; + default: + return NULL; + } } int is_inside_dir(const char *dir) |