diff options
-rwxr-xr-x | bxgen.c | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -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'; |