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 <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Sixt
2007-12-08 23:12:41 +01:00
parent 71d36f4301
commit b54486636e

View File

@@ -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) {