Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2008-02-20 00:29:40 +0300
committerJunio C Hamano <gitster@pobox.com>2008-02-21 07:21:43 +0300
commit9a13ba1bed0e573a7c4523c0c8ed8465c9f341bb (patch)
treede680bf41303c14c1f7fd00277403a92c8fa998b /setup.c
parentaa9c83c2197cafb884face711ab7235790f9f265 (diff)
prefix_path: use is_absolute_path() instead of *orig == '/'
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/setup.c b/setup.c
index bc80301c42..dc247a84c4 100644
--- a/setup.c
+++ b/setup.c
@@ -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)
@@ -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;