Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *PathEnv;
- char *Tokd;
- char *Tmp;
- const char *Final;
- std::cout << "NULL" << std::endl;
- PathEnv=getenv((const char *) "PATH");
- std::cout << PathEnv << std::endl << strlen(PathEnv) << std::endl;
- Tokd=strtok(PathEnv, (const char*)":");
- while(Tokd != NULL) {
- // char *WotGoesBoom= new char[(strlen(PathEnv) + 1) * sizeof(char)];
- char WotGoesBoom[8192];
- strcat(WotGoesBoom, Tokd);
- strcat(WotGoesBoom, (char*)"/");
- strcat(WotGoesBoom, Engine::ArgZero);
- std::cout << Tokd << std::endl;
- std::cout << WotGoesBoom << std::endl;
- if(Engine::fExists(WotGoesBoom)) {
- Tmp=WotGoesBoom;
- for(int i=0; i<8192; i+=1) {
- WotGoesBoom[i]=0;
- }
- }
- Tokd=strtok(NULL, (const char*)":");
- // delete WotGoesBoom;
- }
- Final=Tmp;
- return Final;
Add Comment
Please, Sign In to add comment