2 Copyright © 2004, The AROS Development Team. All rights reserved.
5 POSIX function dirname().
11 #include <aros/debug.h>
13 char *dirname(char *filename
)
18 if (!filename
|| *filename
== '\0')
20 D(bug("dirname()=.\n"));
24 uname
= (char *)__path_a2u(filename
);
28 if (pos
[0] == '/' && pos
[1] == '\0')
30 D(bug("dirname(/)=/\n"));
34 D(bug("dirname(%s)=", filename
));
36 pos
= uname
+ strlen(uname
);
37 while (pos
[-1] == '/')
54 D(bug("%s\n", uname
));