windows:
#if 1
//#ifdef NDEBUG
char *lpstr1 = (char*)malloc(MAX_PATH);
GetCurrentDirectory(MAX_PATH, lpstr1);
printf("%d-%s\n", MAX_PATH, lpstr1);
(strrchr(lpstr1, '\\'))[0] = 0;
printf("%d-%s\n", MAX_PATH, lpstr1);
(strrchr(lpstr1, '\\'))[0] = 0;
printf("%d-%s\n", MAX_PATH, lpstr1);
SetCurrentDirectory(lpstr1);
//#endif
#endif
linux:
chdir()