From: Johannes Sixt Date: Tue, 19 Feb 2008 21:29:40 +0000 (+0100) Subject: prefix_path: use is_absolute_path() instead of *orig == '/' X-Git-Tag: v1.5.5-rc0~175 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9a13ba1bed0e573a7c4523c0c8ed8465c9f341bb;p=git.git prefix_path: use is_absolute_path() instead of *orig == '/' Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- diff --git a/setup.c b/setup.c index bc80301c4..dc247a84c 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;