From 8fd3464127b9ff15ae804253675088ba85e94990 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 24 Jan 2008 10:49:59 +0000 Subject: exists now returns the handle to the file instead of just a boolean --- lib/LuaHandle.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc index 7ff7143..d4a204a 100644 --- a/lib/LuaHandle.cc +++ b/lib/LuaHandle.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: LuaHandle.cc,v 1.24 2008-01-21 17:55:43 pixel Exp $ */ +/* $Id: LuaHandle.cc,v 1.25 2008-01-24 10:49:59 pixel Exp $ */ #include "LuaHandle.h" @@ -633,19 +633,19 @@ int sLuaHandle::exists(lua_State * __L) { int n = L->gettop(); bool r = true; - if (n != 1) { - L->error("Incorrect number of arguments to function exists"); + if ((n != 1) || !(L->isstring(1))) { + L->error("Incorrect arguments to function exists"); } try { - Input testing(L->tostring()); + LuaInput i(new Input(L->tostring())); + i.pushdestruct(L); } catch (IOGeneral &) { + L->push(); r = false; } - L->push(r); - return 1; } -- cgit v1.2.3