diff options
-rw-r--r-- | lib/supportlib.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/supportlib.lua b/lib/supportlib.lua index 2dc26f2..4d2d2dc 100644 --- a/lib/supportlib.lua +++ b/lib/supportlib.lua @@ -19,12 +19,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: supportlib.lua,v 1.4 2007-05-30 11:57:10 pixel Exp $ */ +/* $Id: supportlib.lua,v 1.5 2007-05-31 14:23:49 pixel Exp $ */ ]]-- -- --- Dumps a file to the screen. +-- Dumps a file or a table to the screen. -- function display(inp, n) @@ -35,9 +35,15 @@ function display(inp, n) error("Display needs a string or an Input object") end + if inp.__objtype ~= "Handle" then + local t = inp + inp = Buffer() + dumpvars(inp, t, "table") + end + i = 0 - while(not inp:isclosed()) do + while (not inp:isclosed()) do i = i + 1 print(inp:read()) if ((n ~= nil) and (i >= n)) then |