X-Git-Url: https://git.kengrimes.com/?p=henge%2Fapc.git;a=blobdiff_plain;f=src%2Fir.c;h=d0abf1fffbceb7ecad46e66260f038f7dbb042b4;hp=341028e69e206ae295d9a3c344fbe28e363098f6;hb=10757d8de188be16a6d805c074ddff27e63f5b89;hpb=72b4785c5b92263d4939ab635cb8bf2686e7c4b4 diff --git a/src/ir.c b/src/ir.c index 341028e..d0abf1f 100644 --- a/src/ir.c +++ b/src/ir.c @@ -672,23 +672,18 @@ void ir_test(void) static void crawl_class ( struct ir_class_t* class ) -{ wprintf("%U/\n", class->name); - if(chdir((char*)class->name)) - eprintf("CHDIR %U from %s\n",class->name,getcwd(NULL,255)); - if (class->nextchild != NULL) - crawl_class(class->nextchild); - if (class->root_set != NULL) - crawl_set(class->root_set, 0); - if (class->nextsib != NULL) - { if (chdir("..")) +{ struct ir_class_t* iter; + for (iter = class->nextchild; iter != NULL; iter = iter->nextsib) + { wprintf("%U/\n", iter->name); + if(chdir((char*)iter->name)) + eprintf("CHDIR %U from %s\n",iter->name,getcwd(NULL,255)); + crawl_class(iter); + if (iter->root_set != NULL) + crawl_set(iter->root_set, 0); + uprintf("%U\\\n",iter->name); + if (chdir("..")) eprintf("CHDIR ..\n"); - crawl_class(class->nextsib); - if(chdir((char*)class->name)) - eprintf("CHDIR %U from %s\n",class->name,getcwd(NULL,255)); } - uprintf("%U\\\n",class->name); - if (chdir("..")) - eprintf("CHDIR ..\n"); } static