Make prefix_path() return char* without const
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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
309be813c9
commit
edc54fb5d4
2
setup.c
2
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);
|
||||
|
Reference in New Issue
Block a user