From 7b8df4431a7e3e8003e4b1ba399e8dae17135566 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Fri, 27 May 2011 16:59:46 +0200 Subject: [PATCH] Use proper chunk names, so tracebacks show filenames. --- src/modules/filesystem/physfs/Filesystem.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 2044acf43..4aea7bd0a 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -530,19 +530,19 @@ namespace physfs if(!lua_isstring(L, -1)) return luaL_error(L, "The argument must be a string."); - const char * filename = lua_tostring(L, -1); + std::string filename = lua_tostring(L, -1); // The file must exist. - if(!exists(filename)) - return luaL_error(L, "File %s does not exist.", filename); + if(!exists(filename.c_str())) + return luaL_error(L, "File %s does not exist.", filename.c_str()); // Create the file. - File * file = newFile(filename); + File * file = newFile(filename.c_str()); // Get the data from the file. Data * data = file->read(); - int status = luaL_loadbuffer(L, (const char *)data->getData(), data->getSize(), filename); + int status = luaL_loadbuffer(L, (const char *)data->getData(), data->getSize(), ("@" + filename).c_str()); data->release(); file->release();