diff options
author | B. Watson <urchlay@slackware.uk> | 2024-06-25 19:58:44 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-06-25 19:58:44 -0400 |
commit | ec5d94be4d5bf775599f67875e07da869b9c1834 (patch) | |
tree | ba57825ab6c5b4d5fe1299a7b397a2d4ca555dda | |
parent | 78b7b515b2140d92d635e9f59d701877bebe8b11 (diff) | |
download | bw-atari8-tools-ec5d94be4d5bf775599f67875e07da869b9c1834.tar.gz |
listbas: exit cleanly if code is protected.
-rw-r--r-- | listbas.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -196,6 +196,12 @@ void close_outfh(void) { } } +CALLBACK(code_prot) { + fprintf(stderr, "%s: Program is code-protected, stopping at line %d.\n", self, lineno); + close_outfh(); + exit(0); +} + void list(void) { on_start_line = print_lineno; on_cmd_token = print_cmd; @@ -203,6 +209,7 @@ void list(void) { on_var_token = print_varname; on_end_line = print_newline; on_text = print_text; + on_bad_line_length = code_prot; walk_code(0, 32767 + immediate); } @@ -214,6 +221,9 @@ int main(int argc, char **argv) { readfile(); parse_header(); + if(!vntable_ok()) + die("Program is variable-protected; unprotect it first."); + setup_outfh(); list(); close_outfh(); |