fix(socket) if " " at begin execption occurs

This commit is contained in:
coderaiser 2013-11-06 09:45:42 +00:00
parent 8843036584
commit 498ed5134a

View file

@ -120,7 +120,7 @@
function onMessage(pConnNum, pSocket) {
return function(pCommand) {
var lMsg, lJSON, lWinCommand, lExec_func, lDir,
lHome, lError, lRet, lExecSymbols;
lHome, lError, lRet, lExecSymbols, isContain;
Util.log('#' + pConnNum + ': ' + pCommand);
@ -191,11 +191,11 @@
if(!ClientFuncs[pConnNum])
ClientFuncs[pConnNum] = getExec(pSocket, pConnNum);
lExec_func = ClientFuncs[pConnNum];
lExec_func = ClientFuncs[pConnNum];
lExecSymbols = ['*','#', '&', '{', '}', '|', '\'', '"'];
isContain = Util.isContainStr(pCommand, lExecSymbols);
lExecSymbols = ['*','#', '&', '{', '}', '|', '\'', '"'];
if (Util.isContainStr(pCommand, lExecSymbols))
if (pCommand[0] === ' ' || isContain)
exec(pCommand, lExec_func);
else
getSpawn(pSocket, pConnNum, pCommand);