aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--listbas.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/listbas.c b/listbas.c
index 86bb3f7..bc56695 100644
--- a/listbas.c
+++ b/listbas.c
@@ -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();