Comparison

plugins/mod_console.lua @ 3028:e095d2a98936

Merge 0.6->0.7
author Waqas Hussain <waqas20@gmail.com>
date Fri, 07 May 2010 16:17:48 +0500
parent 3025:f1e1b7629807
parent 3027:b5beb7b15ac4
child 3044:a6f89c72d305
comparison
equal deleted inserted replaced
3025:f1e1b7629807 3028:e095d2a98936
83 end 83 end
84 end 84 end
85 85
86 session.env._ = data; 86 session.env._ = data;
87 87
88 local chunk, err = loadstring("return "..data); 88 local chunkname = "=console";
89 local chunk, err = loadstring("return "..data, chunkname);
89 if not chunk then 90 if not chunk then
90 chunk, err = loadstring(data); 91 chunk, err = loadstring(data, chunkname);
91 if not chunk then 92 if not chunk then
92 err = err:gsub("^%[string .-%]:%d+: ", ""); 93 err = err:gsub("^%[string .-%]:%d+: ", "");
93 err = err:gsub("^:%d+: ", ""); 94 err = err:gsub("^:%d+: ", "");
94 err = err:gsub("'<eof>'", "the end of the line"); 95 err = err:gsub("'<eof>'", "the end of the line");
95 session.print("Sorry, I couldn't understand that... "..err); 96 session.print("Sorry, I couldn't understand that... "..err);