diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-02-09 16:41:16 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-09 16:41:16 -0800 |
commit | 05f08e4c9ed4a9c34eb2d62300189a3e8a86b5a5 (patch) | |
tree | 798769c8699d41697857ab3977da2616f9714653 /setup.c | |
parent | 70ec8687a66eb7d3b273d9a7996fab309d2b0974 (diff) | |
parent | 18e051a3981f38db08521bb61ccf7e4571335353 (diff) | |
download | git-05f08e4c9ed4a9c34eb2d62300189a3e8a86b5a5.tar.gz |
Merge branch 'cb/setup'
* cb/setup:
setup: translate symlinks in filename when using absolute paths
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -7,10 +7,13 @@ static int inside_work_tree = -1; char *prefix_path(const char *prefix, int len, const char *path) { const char *orig = path; - char *sanitized = xmalloc(len + strlen(path) + 1); - if (is_absolute_path(orig)) - strcpy(sanitized, path); - else { + char *sanitized; + if (is_absolute_path(orig)) { + const char *temp = make_absolute_path(path); + sanitized = xmalloc(len + strlen(temp) + 1); + strcpy(sanitized, temp); + } else { + sanitized = xmalloc(len + strlen(path) + 1); if (len) memcpy(sanitized, prefix, len); strcpy(sanitized + len, path); |