* [PATCH] prefix_path: use is_absolute_path() instead of *orig == '/'
@ 2008-02-19 21:29 Johannes Sixt
0 siblings, 0 replies; only message in thread
From: Johannes Sixt @ 2008-02-19 21:29 UTC (permalink / raw)
To: gitster; +Cc: git
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
This goes on top of branch jc/setup.
-- Hannes
| 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
--git a/setup.c b/setup.c
index 5e4cecb..18ddfae 100644
--- a/setup.c
+++ b/setup.c
@@ -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;
--
1.5.4.2.940.g0f70f.dirty
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-19 21:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-19 21:29 [PATCH] prefix_path: use is_absolute_path() instead of *orig == '/' Johannes Sixt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).