From 4cc5a5fcdd12a53f1ffd587adb0779bc5003e5c0 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 26 Nov 2015 18:55:00 +0000 Subject: [PATCH] Only validate plugin headers Validating the whole plugin can be orders of magnitude slower, libloadorder only uses the headers, and if the header is valid it's probably good enough. This requires libespm v2.4. --- .travis.yml | 4 ++-- README.md | 2 +- src/backend/Plugin.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9016413..5d16252 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,8 @@ install: # Currently inside the cloned repo path. - cd .. # Install libespm. - - wget https://github.com/WrinklyNinja/libespm/archive/2.2.0.tar.gz -O - | tar -xz - - mv libespm-2.2.0 libespm + - wget https://github.com/WrinklyNinja/libespm/archive/2.4.0.tar.gz -O - | tar -xz + - mv libespm-2.4.0 libespm # Install Google Test - wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz -O - | tar -xz - cd googletest-release-1.7.0 diff --git a/README.md b/README.md index 04be65e..47dc8e7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Instructions for other platforms are not provided, but the process for building * [Boost](http://www.boost.org) Filesystem and Locale libraries: tested with v1.55.0 and v1.59.0. * [Google Test](https://github.com/google/googletest): Required to build libloadorder's tests, but not the library itself. Tested with v1.7.0. -* [Libespm](http://github.com/WrinklyNinja/libespm) v2.2.0 +* [Libespm](http://github.com/WrinklyNinja/libespm) v2.4.0 ### Windows diff --git a/src/backend/Plugin.cpp b/src/backend/Plugin.cpp index 90b8845..a5c2f1c 100644 --- a/src/backend/Plugin.cpp +++ b/src/backend/Plugin.cpp @@ -126,8 +126,8 @@ namespace liblo { bool Plugin::isValid(const std::string& filename, const GameSettings& gameSettings) { string name = trimGhostExtension(filename); - return libespm::Plugin::isValid(gameSettings.getPluginsFolder() / name, gameSettings.getLibespmId()) - || libespm::Plugin::isValid(gameSettings.getPluginsFolder() / (name + ".ghost"), gameSettings.getLibespmId()); + return libespm::Plugin::isValid(gameSettings.getPluginsFolder() / name, gameSettings.getLibespmId(), true) + || libespm::Plugin::isValid(gameSettings.getPluginsFolder() / (name + ".ghost"), gameSettings.getLibespmId(), true); } std::string Plugin::trimGhostExtension(const std::string& filename) {