Closed jaypei closed 9 years ago
I think it is right: the first check is specific for 5.1, where os.execute() returns numeric codes, and after the "or" the check is for later Luas, that return the usual "true or nil,error" pattern, A more verbose version of the logic would be:
if (_VERSION =='Lua 5.1' and ret ~= 0) or ((_VERSION =='Lua 5.2' or _VERSION =='Lua 5.3') and ret ~= true) then
Is it not working on you platform?
Yes, let us suppose that logic is true, and lua version is 5.1, and the sleep command will return 0, then the expression will equivalent to :
if (true and false or true) then
os.exit()
end
The application will quit. I think the verbose version is more explicit.
Actually, you were right and the logic is wrong. Under Lua 5.1, and with a non zero return, the system was exiting. I pushed a fix.
Seems the logic of the expression is wrong.