From b54486636e4f7ef7758e4cc0158c1446d263b253 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sat, 8 Dec 2007 23:12:41 +0100 Subject: [PATCH] Rename is_path_absolute() in sha1_file.c to offset_1st_component(). This better describes the purpose of the function. Signed-off-by: Johannes Sixt --- sha1_file.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sha1_file.c b/sha1_file.c index 1984e35823..e7deefc769 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -83,20 +83,18 @@ int get_sha1_hex(const char *hex, unsigned char *sha1) return 0; } -/* returns the number of chars to skip to first component */ -static inline int is_path_absolute(const char *path) +static inline int offset_1st_component(const char *path) { #ifdef __MINGW32__ if (isalpha(path[0]) && path[1] == ':') return 2 + (path[2] == '/'); - /* TODO: C:dir/file 'relative' paths are not catered for */ #endif return *path == '/'; } int safe_create_leading_directories(char *path) { - char *pos = path + is_path_absolute(path); + char *pos = path + offset_1st_component(path); struct stat st; while (pos) {