forked from mia/Aegisub
Canonicalize Automation script file names for nicer errors
This commit is contained in:
parent
2be9218560
commit
646e5deb52
1 changed files with 3 additions and 1 deletions
|
@ -29,7 +29,9 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace Automation4 {
|
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));
|
std::unique_ptr<std::istream> file(agi::io::Open(filename, true));
|
||||||
file->seekg(0, std::ios::end);
|
file->seekg(0, std::ios::end);
|
||||||
size_t size = file->tellg();
|
size_t size = file->tellg();
|
||||||
|
|
Loading…
Reference in a new issue