summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2008-01-24 10:49:59 +0000
committerpixel <pixel>2008-01-24 10:49:59 +0000
commit8fd3464127b9ff15ae804253675088ba85e94990 (patch)
tree9b2702da2feb36b4ff63a5d121eea4b5b84372d9 /lib
parenteead6105a7dcf2cd561b4bd50604c584a4c46cdc (diff)
exists now returns the handle to the file instead of just a boolean
Diffstat (limited to 'lib')
-rw-r--r--lib/LuaHandle.cc12
1 files 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;
}