Index: eagle_bin/test_parser/eagle_bin.c =================================================================== --- eagle_bin/test_parser/eagle_bin.c (revision 9407) +++ eagle_bin/test_parser/eagle_bin.c (revision 9408) @@ -19,8 +19,9 @@ } pcb_eagle_type_t; typedef enum { - SS_DIRECT, /* it specifies the number of direct children */ - SS_RECURSIVE/* it specifies the number of all children, recursively */ + SS_DIRECT, /* it specifies the number of direct children */ + SS_RECURSIVE, /* it specifies the number of all children, recursively */ + SS_RECURSIVE_MINUS_1 /* same as SS_RECURSIVE, but decrease the children count first */ } pcb_eagle_ss_type_t; @@ -60,7 +61,7 @@ }, { /* subsection sizes */ /* {2, 2, SS_DIRECT},*/ - {4, 4, SS_RECURSIVE}, + {4, 4, SS_RECURSIVE_MINUS_1}, TERM }, { /* attributes */ @@ -1125,8 +1126,11 @@ printf("%s # fin, processed=%d lp=%ld }\n", ind, processed, lp); } else { - long rem = numch, lp = 0; + long rem, lp = 0; printf("%s #About to parse %ld recursive sub-blocks {\n", ind, numch); + if (ss->ss_type == SS_RECURSIVE_MINUS_1) + numch--; + rem = numch; for(n = 0; n < numch && rem > 0; n++) { int res = read_block(&rem, level+1, ctx, f, fn); if (res < 0)