Prevent possible crash when loading file with scheme_load_file.

From SVN version 101 of offical version of TinyScheme.
This commit is contained in:
Kevin Cozens 2014-08-17 18:06:03 -04:00
parent 8b9696a7fa
commit ac45213ccd
1 changed files with 2 additions and 0 deletions

View File

@ -5114,6 +5114,8 @@ void scheme_load_named_file(scheme *sc, FILE *fin, const char *filename) {
sc->load_stack[0].rep.stdio.curr_line = 0;
if(fin!=stdin && filename)
sc->load_stack[0].rep.stdio.filename = store_string(sc, strlen(filename), filename, 0);
else
sc->load_stack[0].rep.stdio.filename = NULL;
#endif
sc->inport=sc->loadport;