@matheusbsbs / matheus-bagliano / commits / 9a13ba1bed
Fork 0

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>

Johannes Sixt committed Feb 19, 2008 at 22:29 UTC 9a13ba1bed0e573a7c4523c0c8ed8465c9f341bb
1 file changed +2 -2
setup.c
+2 -2
@@ -91,7 +91,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
91 {
92 const char *orig = path;
93 char *sanitized = xmalloc(len + strlen(path) + 1);
94 - if (*orig == '/')
94 + if (is_absolute_path(orig))
95 strcpy(sanitized, path);
96 else {
97 if (len)
@@ -100,7 +100,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
100 }
101 if (sanitary_path_copy(sanitized, sanitized))
102 goto error_out;
103 - if (*orig == '/') {
103 + if (is_absolute_path(orig)) {
104 const char *work_tree = get_git_work_tree();
105 size_t len = strlen(work_tree);
106 size_t total = strlen(sanitized) + 1;