From 564bb31c49dfe76f25d0731fb808a4c77884b127 Mon Sep 17 00:00:00 2001 From: gamemanj Date: Wed, 1 Apr 2015 00:28:26 +0100 Subject: [PATCH] fixed string parsing...I thought I tested this! Apparently I messed up string parsing. I thought I had tested this-maybe I only tried a empty string or something. Also, warning for future people reading this saga of insanity: Do not write code while tired. --- mesecons_luacontroller/init.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua index c139265..befacc4 100644 --- a/mesecons_luacontroller/init.lua +++ b/mesecons_luacontroller/init.lua @@ -385,14 +385,13 @@ local function lexLua(code) local inEscape=true local rstr="" for i=1,str:len() do - local c=str:sub(1,1) + local c=str:sub(i,i) + rstr=rstr..c if inEscape then - rstr=rstr..c inEscape=false else - if c==quoteType then return rstr..quoteType end + if c==quoteType then return rstr end if c=="\\" then inEscape=true end - rstr=rstr..c end end return nil --unfinished string