From: Junio C Hamano Date: Mon, 31 Jan 2011 03:03:00 +0000 (-0800) Subject: Merge branch 'cb/setup' into jch X-Git-Tag: ko-pu~20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9ee973c2d9a05ba716c675f43e21bf436426a161;p=git.git Merge branch 'cb/setup' into jch * cb/setup: setup: translate symlinks in filename when using absolute paths --- 9ee973c2d9a05ba716c675f43e21bf436426a161 diff --cc setup.c index dadc66659,8031f99e9..021d0133a --- a/setup.c +++ b/setup.c @@@ -4,13 -4,16 +4,16 @@@ static int inside_git_dir = -1; static int inside_work_tree = -1; -const char *prefix_path(const char *prefix, int len, const char *path) +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);