diff --git a/source/load.cpp b/source/load.cpp index f35eab54e..ac696d299 100755 --- a/source/load.cpp +++ b/source/load.cpp @@ -8379,6 +8379,8 @@ STATUS GldLoader::loadall_glm(const char *fname) /**< a pointer to the first cha } IN_MYCONTEXT output_verbose("file '%s' is %d bytes long", file,fsize); add_depend(filename,file); + strcpy(filename,file); + linenum = 0; strcpy(global_loader_filename,filename); global_loader_linenum = 1; diff --git a/source/module.cpp b/source/module.cpp index 1f244e5bc..60307a38a 100644 --- a/source/module.cpp +++ b/source/module.cpp @@ -2942,6 +2942,12 @@ void module_help_md(MODULE *mod, CLASS *oclass) output_raw("\n"); } +static bool isglm(const char *file) +{ + const char *ext = file + strlen(file) - 4; + return strcmp(ext,".glm")==0; +} + void module_load_templates(MODULE *mod) { if ( mod->templates_loaded || mod->no_templates ) @@ -2969,7 +2975,7 @@ void module_load_templates(MODULE *mod) { output_debug("module_load_templates(MODULE *mod=<%s>): '%s' is a directory -- ignoring",mod->name,file); } - else + else if ( isglm(file) ) { output_debug("module_load_templates(MODULE *mod=<%s>): loading '%s'",mod->name,file); if ( my_instance->get_loader()->loadall_glm(file) != SUCCESS )