Canonicalize Automation script file names for nicer errors

This commit is contained in:
Thomas Goyne 2013-09-22 17:40:27 -07:00
parent 2be9218560
commit 646e5deb52
1 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,9 @@
#include <memory>
namespace Automation4 {
bool LoadFile(lua_State *L, agi::fs::path const& filename) {
bool LoadFile(lua_State *L, agi::fs::path const& raw_filename) {
auto filename = agi::fs::Canonicalize(raw_filename);
std::unique_ptr<std::istream> file(agi::io::Open(filename, true));
file->seekg(0, std::ios::end);
size_t size = file->tellg();