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:
Johannes Schindelin
2007-08-01 01:28:59 +01:00
committed by Junio C Hamano
parent 73a7a65663
commit e5392c5146
5 changed files with 98 additions and 1 deletions

11
test-absolute-path.c Normal file
View 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;
}