2004-04-21 01:15:41 +00:00
|
|
|
#include <u.h>
|
|
|
|
|
#include <libc.h>
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
main(void)
|
|
|
|
|
{
|
|
|
|
|
char buf[512], *p;
|
|
|
|
|
|
|
|
|
|
p = "???";
|
|
|
|
|
if(getwd(buf, sizeof buf)){
|
|
|
|
|
p = strrchr(buf, '/');
|
|
|
|
|
if(p == nil)
|
|
|
|
|
p = buf;
|
|
|
|
|
else if(p>buf || p[1]!='\0')
|
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
write(1, p, strlen(p));
|
|
|
|
|
exits(0);
|
2020-01-10 14:44:21 +00:00
|
|
|
}
|