diff options
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r-- | src/sc_parse.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c index 328e397..b94f548 100644 --- a/src/sc_parse.c +++ b/src/sc_parse.c @@ -135,22 +135,25 @@ void sc_block_free(SCBlock *bl) static void recursive_show_sc_blocks(const char *prefix, const SCBlock *bl) { while ( bl != NULL ) { + show_sc_block(bl, prefix); + bl = bl->next; + } +} - printf("%s", prefix); - if ( bl->name != NULL ) printf("\\%s ", bl->name); - if ( bl->options != NULL ) printf("[%s] ", bl->options); - if ( bl->contents != NULL ) printf("{%s}", bl->contents); - printf("\n"); - - if ( bl->child != NULL ) { - char new_prefix[strlen(prefix)+3]; - strcpy(new_prefix, " "); - strcat(new_prefix, prefix); - recursive_show_sc_blocks(new_prefix, bl->child); - } - bl = bl->next; +void show_sc_block(const SCBlock *bl, const char *prefix) +{ + printf("%s", prefix); + if ( bl->name != NULL ) printf("\\%s ", bl->name); + if ( bl->options != NULL ) printf("[%s] ", bl->options); + if ( bl->contents != NULL ) printf("{%s}", bl->contents); + printf("\n"); + if ( bl->child != NULL ) { + char new_prefix[strlen(prefix)+3]; + strcpy(new_prefix, " "); + strcat(new_prefix, prefix); + recursive_show_sc_blocks(new_prefix, bl->child); } } |