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