Skip to content

Commit

Permalink
prefix_path: use is_absolute_path() instead of *orig == '/'
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Feb 21, 2008
1 parent aa9c83c commit 9a13ba1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
{
const char *orig = path;
char *sanitized = xmalloc(len + strlen(path) + 1);
if (*orig == '/')
if (is_absolute_path(orig))
strcpy(sanitized, path);
else {
if (len)
Expand All @@ -100,7 +100,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
}
if (sanitary_path_copy(sanitized, sanitized))
goto error_out;
if (*orig == '/') {
if (is_absolute_path(orig)) {
const char *work_tree = get_git_work_tree();
size_t len = strlen(work_tree);
size_t total = strlen(sanitized) + 1;
Expand Down

0 comments on commit 9a13ba1

Please sign in to comment.