Add is_absolute_path() and make_absolute_path()
This patch adds convenience functions to work with absolute paths. The function is_absolute_path() should help the efforts to integrate the MinGW fork. Note that make_absolute_path() returns a pointer to a static buffer. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
73a7a65663
commit
e5392c5146
11
test-absolute-path.c
Normal file
11
test-absolute-path.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include "cache.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
while (argc > 1) {
|
||||
puts(make_absolute_path(argv[1]));
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user