Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Develop fix template load errors (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
aivanova5 authored Oct 26, 2022
1 parent 3016194 commit 40c2ef7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 7 additions & 1 deletion source/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 40c2ef7

Please sign in to comment.