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