Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Closes #87 - Don't send : on last argument unless necessary

  • Loading branch information...
commit 886461c6a4f2d0d266967985b896079787079044 1 parent 8a5d508
@martynsmith authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/irc.js
View
9 lib/irc.js
@@ -597,14 +597,15 @@ Client.prototype.disconnect = function ( message, callback ) { // {{{
self.conn.end();
}; // }}}
Client.prototype.send = function(command) { // {{{
- var args = [];
- for ( var k in arguments )
- args.push(arguments[k]);
- args[args.length-1] = ":" + args[args.length-1];
+ var args = Array.prototype.slice.call(arguments);
// Remove the command
args.shift();
+ if ( args[args.length-1].match(/\s/) ) {
+ args[args.length-1] = ":" + args[args.length-1];
+ }
+
if ( this.opt.debug )
util.log('SEND: ' + command + " " + args.join(" "));
Please sign in to comment.
Something went wrong with that request. Please try again.