summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2007-04-11 00:16:30 +0000
committerpixel <pixel>2007-04-11 00:16:30 +0000
commit558d500be3e016e032b531122bc66fb6026bcd50 (patch)
tree15d89db271407ad028787aabc6c43b26ea248474
parent6b8352135b9c1d3e1ac2ca9fcb49f370ac4ab5a3 (diff)
Introducing "safe" mode for openio (even though it's not used yet) and
fixed a dumpvar() issue with the \r character.
-rw-r--r--include/BLua.h4
-rw-r--r--lib/BLua.cc7
2 files changed, 7 insertions, 4 deletions
diff --git a/include/BLua.h b/include/BLua.h
index 2b9e1b9..b579333 100644
--- a/include/BLua.h
+++ b/include/BLua.h
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: BLua.h,v 1.30 2007-04-02 23:34:30 pixel Exp $ */
+/* $Id: BLua.h,v 1.31 2007-04-11 00:16:30 pixel Exp $ */
#ifndef __BLUA_H__
#define __BLUA_H__
@@ -51,7 +51,7 @@ class Lua : public Base {
virtual ~Lua();
void open_base();
void open_table();
- void open_io();
+ void open_io(bool safe = true);
void open_string();
void open_math();
void open_debug();
diff --git a/lib/BLua.cc b/lib/BLua.cc
index fa35f9f..3f7df94 100644
--- a/lib/BLua.cc
+++ b/lib/BLua.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: BLua.cc,v 1.39 2007-04-02 23:34:30 pixel Exp $ */
+/* $Id: BLua.cc,v 1.40 2007-04-11 00:16:30 pixel Exp $ */
#include <stdlib.h>
#include "BLua.h"
@@ -453,7 +453,7 @@ void Lua::open_table() {
unlock();
}
-void Lua::open_io() {
+void Lua::open_io(bool safe) {
lock();
luaopen_io(L);
lua_pop(L, 1);
@@ -774,6 +774,9 @@ String Lua::escape_string(const String & s) {
case '\n':
r += "\n";
break;
+ case '\r':
+ r += "\r";
+ break;
case '\0':
r += "\\000";
break;