summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbxgen.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/bxgen.c b/bxgen.c
index 855a59c..6f8909d 100755
--- a/bxgen.c
+++ b/bxgen.c
@@ -858,12 +858,33 @@ void unit_write(Pool *pool, i64 unit, u16 target, i64 io_out, void *io_user_data
// Skip file
//
+ printf("String table\n\n");
+
i64 byte_count = atoi(size);
if ((byte_count & 1) == 1)
++byte_count; // align
- n = io_seek(f, byte_count, IO_SEEK_CURSOR, io_user_data); if (n == 0) break;
- current_offset += n;
+ b8 has_line = 0;
+
+ while (byte_count > 0) {
+ c8 c;
+ n = io_read(f, 1, &c, io_user_data); if (n == 0) break;
+ current_offset += n;
+ byte_count -= n;
+ if (c == '\0') {
+ if (has_line) {
+ printf("\n");
+ has_line = 0;
+ }
+ } else {
+ if (c == '/') {
+ if (!has_line)
+ printf("<EMPTY>");
+ } else
+ printf("%c", c);
+ has_line = 1;
+ }
+ }
} else {
if (strstr(id, "/") != NULL)
*strstr(id, "/") = '\0';