diff --git a/source/src/command.cpp b/source/src/command.cpp index 6c386d9d..6a4c1516 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -914,7 +914,11 @@ bool execfile(const char *cfgfile) copystring(s, cfgfile); setcontext("file", cfgfile); char *buf = loadfile(path(s), NULL); - if(!buf) return false; + if(!buf) + { + resetcontext(); + return false; + } execute(buf); delete[] buf; resetcontext();