41 const char *end = str;
64 static const char dot[] =
".";
69 last_slash = path != NULL ? strrchr(path,
'/') : NULL;
73 last_slash = path != NULL ? strrchr(path,
'\\') : NULL;
74 separator = last_slash ?
'\\' :
'/';
77 if (last_slash != NULL && last_slash != path && last_slash[1] ==
'\0')
82 for (runp = last_slash; runp != path; --runp)
84 if (runp[-1] != separator)
93 last_slash = (
char *)
__memrchr(path, separator, runp - path);
97 if (last_slash != NULL)
102 for (runp = last_slash; runp != path; --runp)
104 if (runp[-1] != separator)
117 if (last_slash == path + 1)
123 last_slash = path + 1;
131 last_slash[0] =
'\0';