Sign in
plan9port
/
plan9
/
32c6e78c6c4c13b63d8dc30aa395cfcc6e686c0a
/
.
/
src
/
cmd
/
pbd.c
blob: 2e859f84874ca7ed564474e690df7a9734ecabba [
file
] [
log
] [
blame
]
#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
);
}