2 * Copyright (C) 2002 Manuel Novoa III
3 * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
12 char *dirname(char *path
)
14 static const char null_or_empty_or_noslash
[] = ".";
24 while (*s
&& (*s
!= '/')) ++s
;
26 while (*s
== '/') ++s
;
36 if ((*++last
== '/') && (last
[1] == 0)) {
44 return (char *) null_or_empty_or_noslash
;