1#include "../git-compat-util.h"2#include "../cache.h"34int cygwin_offset_1st_component(const char *path)5{6const char *pos = path;7/* unc paths */8if (is_dir_sep(pos[0]) && is_dir_sep(pos[1])) {9/* skip server name */10pos = strchr(pos + 2, '/');11if (!pos)12return 0; /* Error: malformed unc path */1314do {15pos++;16} while (*pos && pos[0] != '/');17}18return pos + is_dir_sep(*pos) - path;19}