MCPcopy Create free account
hub / github.com/NetHack/NetHack / exename

Function exename

sys/windows/windmain.c:875–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873boolean has_fakeconsole;
874
875char *
876exename(void)
877{
878 int bsize = PATHLEN;
879 char *tmp = exenamebuf, *tmp2;
880
881#ifdef UNICODE
882 {
883 TCHAR wbuf[PATHLEN * 4];
884 GetModuleFileName((HANDLE) 0, wbuf, PATHLEN * 4);
885 WideCharToMultiByte(CP_ACP, 0, wbuf, -1, tmp, bsize, NULL, NULL);
886 }
887#else
888 *(tmp + GetModuleFileName((HANDLE) 0, tmp, bsize)) = '\0';
889#endif
890 tmp2 = strrchr(tmp, PATH_SEPARATOR);
891 if (tmp2)
892 *tmp2 = '\0';
893 tmp2++;
894 return tmp2;
895}
896
897boolean
898fakeconsole(void)

Callers

nothing calls this directly

Calls 1

strrchrFunction · 0.85

Tested by

no test coverage detected