make_nonrelative_path: Use is_absolute_path()
This helps porting to Windows. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
218bf69f0b
commit
e048a49f96
2
path.c
2
path.c
@ -314,7 +314,7 @@ const char *make_nonrelative_path(const char *path)
|
|||||||
{
|
{
|
||||||
static char buf[PATH_MAX + 1];
|
static char buf[PATH_MAX + 1];
|
||||||
|
|
||||||
if (path[0] == '/') {
|
if (is_absolute_path(path)) {
|
||||||
if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
|
if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
|
||||||
die ("Too long path: %.*s", 60, path);
|
die ("Too long path: %.*s", 60, path);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user