33 static const char dot[] =
".";
37 last_slash = path != NULL ? strrchr (path,
'/') : NULL;
39 if (last_slash == path)
43 else if (last_slash != NULL && last_slash[1] ==
'\0')
45 last_slash = memchr (path, last_slash - path,
'/');
47 if (last_slash != NULL)
char * dirname(char *path)