crawl_class update
authorken <ken@mihrtec.com>
Sat, 21 Jan 2017 23:13:51 +0000 (15:13 -0800)
committerken <ken@mihrtec.com>
Sat, 21 Jan 2017 23:13:51 +0000 (15:13 -0800)
src/ir.c

index 341028e..d0abf1f 100644 (file)
--- a/src/ir.c
+++ b/src/ir.c
@@ -672,23 +672,18 @@ void     ir_test(void)
 static\r
 void crawl_class\r
 ( struct ir_class_t* class )\r
-{ wprintf("%U/\n", class->name);\r
-  if(chdir((char*)class->name))\r
-    eprintf("CHDIR %U from %s\n",class->name,getcwd(NULL,255));\r
-  if (class->nextchild != NULL)\r
-      crawl_class(class->nextchild);\r
-  if (class->root_set != NULL)\r
-    crawl_set(class->root_set, 0);\r
-  if (class->nextsib != NULL)\r
-    { if (chdir(".."))\r
+{ struct ir_class_t* iter;\r
+  for (iter = class->nextchild; iter != NULL; iter = iter->nextsib)\r
+    { wprintf("%U/\n", iter->name);\r
+      if(chdir((char*)iter->name))\r
+       eprintf("CHDIR %U from %s\n",iter->name,getcwd(NULL,255));\r
+      crawl_class(iter);\r
+      if (iter->root_set != NULL)\r
+        crawl_set(iter->root_set, 0);\r
+      uprintf("%U\\\n",iter->name);\r
+      if (chdir(".."))\r
        eprintf("CHDIR ..\n");\r
-      crawl_class(class->nextsib);\r
-      if(chdir((char*)class->name))\r
-       eprintf("CHDIR %U from %s\n",class->name,getcwd(NULL,255));\r
     }\r
-  uprintf("%U\\\n",class->name);\r
-  if (chdir(".."))\r
-    eprintf("CHDIR ..\n");\r
 }\r
 \r
 static\r