We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0912d16 commit 6bc0f72Copy full SHA for 6bc0f72
1 file changed
connection.js
@@ -66,7 +66,14 @@ module.exports = function (socket, cmdHandler) {
66
function executeCommandBuffer(buffer, listOk) {
67
// execute all commands in the command buffer in the order and waiting for their response
68
return buffer.reduce((p, command, i) => p.then(() => {
69
- let args = command.match(/\w+|"(?:\\"|[^"])+/g);
+ let reg = /"([^"]*)"|[^\s]+/g;
70
+ let args = [];
71
+ let match;
72
+
73
+ while (match = reg.exec(command)) {
74
+ args.push(match[1] || match[0]);
75
+ }
76
77
return executeCommand(args[0], args.slice(1)).then((resp) => {
78
// write the command response
79
socket.write(resp);
0 commit comments