diff --git a/include/config.h b/include/config.h index a711bf3..76a1d44 100755 --- a/include/config.h +++ b/include/config.h @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Marble versioning information #define MARBLE_MAJOR_CODENAME "Clearies" -#define MARBLE_VERSION "0.6.0" +#define MARBLE_VERSION "0.6.1" #define MAX_KEYWORD_SIZE 15 #define MAX_OPERATORS_SIZE 3 diff --git a/src/system/interpreter.cpp b/src/system/interpreter.cpp index b98a6dd..7dcc005 100755 --- a/src/system/interpreter.cpp +++ b/src/system/interpreter.cpp @@ -676,6 +676,7 @@ Splitter Interpreter::loadScript(const char *filename) this->filename = filename; if (!hasRunScript(filename)) this->scripts_run.push_back(getAbsolutePath(std::string(filename))); + // Lets load this script FILE *file = fopen(filename, "r"); if (!file) @@ -689,6 +690,12 @@ Splitter Interpreter::loadScript(const char *filename) throw IOException("Failed to seek to the end of the file: " + std::string(filename)); } + std::string filename_str = std::string(filename); + if (!isFile(filename_str)) + { + throw IOException("The provided file: " + filename_str + " is a directory"); + } + long data_len = ftell(file); rewind(file); char *data = new char[data_len];