henesyinit from p9f47575dc5 years agoHistory
26 lines · 363 B · C
RawDownload
#include <u.h>#include <libc.h> voidmain(void){	char buf[DIRLEN];	char pathname[512];	char *cp; 	cp = "?";	if(stat(".", buf) == 0){		if(buf[0] == '/'){			if(getwd(pathname, sizeof(pathname))){				cp = strrchr(pathname, '/');				if(cp == 0)					cp = pathname;				else					cp++;			}		} else			cp = buf;	}	write(1, cp, strlen(cp));	exits(0);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t