From 304601534df0b1eeee0865d55bb3b4da063702e3 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 19 Feb 2008 22:11:12 +0100 Subject: [PATCH] prefix_path: use is_absolute_path() instead of *orig == '/' Signed-off-by: Johannes Sixt --- setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index 5e4cecb893..18ddfae04f 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;