/* Get the first occurence of a directory delimiter ('/' or '\') in a string. Return index into string if found, -1 otherwise.  */
static int dirdelim(char *str)
/* Get the first occurence of a directory delimiter ('/' or '\') in a string. Return index into string if found, -1 otherwise.  */
static int dirdelim(char *str)
{
	char *start = str;
	while (*str != '\0') {
		if (ISDIRDELIM(*str)) return str - start;
		str++;
	}
	return -1;
}