From edc54fb5d4ce6774fc2ac76779bd57dc2d6ab189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Thu, 11 Nov 2010 21:08:03 +0700 Subject: Make prefix_path() return char* without const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prefix_path() allocates new buffer. There's no reason for it to keep the buffer for itself and waste memory. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.c') diff --git a/setup.c b/setup.c index 833db12bc4..f930dc0963 100644 --- a/setup.c +++ b/setup.c @@ -4,7 +4,7 @@ static int inside_git_dir = -1; static int inside_work_tree = -1; -const char *prefix_path(const char *prefix, int len, const char *path) +char *prefix_path(const char *prefix, int len, const char *path) { const char *orig = path; char *sanitized = xmalloc(len + strlen(path) + 1); -- cgit v1.2.3