X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Flexer.c;h=f79a6e6118c823aed23552c54b77431786ca41c0;hb=c881aa3386c00d7021ffabf2f66275d6c110c1c1;hp=b741ff0bdc99bd63e0d311a465d95989c0913fd6;hpb=8760c1ba6442153afe76bcac742e086f90c59fe8;p=inform.git diff --git a/src/lexer.c b/src/lexer.c index b741ff0..f79a6e6 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -2,7 +2,7 @@ /* "lexer" : Lexical analyser */ /* */ /* Part of Inform 6.35 */ -/* copyright (c) Graham Nelson 1993 - 2020 */ +/* copyright (c) Graham Nelson 1993 - 2021 */ /* */ /* Inform is free software: you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ @@ -953,6 +953,8 @@ extern int is_systemfile(void) extern void set_origsource_location(char *source, int32 line, int32 charnum) { + int file_no; + if (!source) { /* Clear the Origsource declaration. */ CurrentLB->orig_file = 0; @@ -963,7 +965,7 @@ extern void set_origsource_location(char *source, int32 line, int32 charnum) } /* Get the file number for a new or existing InputFiles entry. */ - int file_no = register_orig_sourcefile(source); + file_no = register_orig_sourcefile(source); CurrentLB->orig_file = file_no; CurrentLB->orig_source = InputFiles[file_no-1].filename;