+size_t yaz_filepath_comp(const char **path_p, const char **comp)
+{
+ const char *path = *path_p;
+ size_t len;
+ const char *path_sep;
+
+ /* somewhat dirty since we have to consider Windows
+ * drive letters..
+ */
+ if (path[0] && strchr ("/\\.", path[0]))
+ path_sep = strchr (path+1, ':');
+ else if (path[0] && path[1])
+ path_sep = strchr (path+2, ':');
+ else
+ path_sep = 0;
+
+ if (path_sep)
+ {
+ len = path_sep - path;
+ *path_p = path + len + 1;
+ }
+ else
+ {
+ len = strlen(path);
+ *path_p = path + len;
+ }
+ *comp = path;
+ return len;
+}
+