prefix_path: use is_absolute_path() instead of *orig == '/'
PATCH 1/1 prefix_path: use is_absolute_path() instead of *orig == '/'
Signed-off-by Johannes Sixt <[email protected]>
---
This goes on top of branch jc/setup.
-- Hannes
setup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
setup.c +2 -2
@@ -91,7 +91,7 @@ const char *prefix_path(const char *prefix, int len, {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, }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 ;
Signature · 1 line
1.5.4.2.940.g0f70f.dirty