Use is_absolute_path() in diff-lib.c, lockfile.c, setup.c, trace.c
Using the helper function to test for absolute paths makes porting easier. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e0fda6abd1
commit
ecf4831d89
@ -231,7 +231,7 @@ static int handle_diff_files_args(struct rev_info *revs,
|
||||
static int is_outside_repo(const char *path, int nongit, const char *prefix)
|
||||
{
|
||||
int i;
|
||||
if (nongit || !strcmp(path, "-") || path[0] == '/')
|
||||
if (nongit || !strcmp(path, "-") || is_absolute_path(path))
|
||||
return 1;
|
||||
if (prefixcmp(path, "../"))
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user