Author: ehuelsmann Date: Mon May 15 18:54:48 2006 New Revision: 155
Modified: trunk/parse-message.lisp trunk/test/test-parse-message.lisp trunk/utility.lisp Log: Fix (amongst others) the MODE command where there is no terminating #\Return.
Modified: trunk/parse-message.lisp ============================================================================== --- trunk/parse-message.lisp (original) +++ trunk/parse-message.lisp Mon May 15 18:54:48 2006 @@ -50,7 +50,7 @@ arguments part of the message as a list. Returns nil if the arguments part is not present." (multiple-value-bind (end-position return-argument) - (cut-before string " :" '(#\Return) :start start) + (cut-before string " :" '(#\Return) :start start :cut-to-end t) (values end-position (tokenize-string return-argument :delimiters '(#\Space)))))
Modified: trunk/test/test-parse-message.lisp ============================================================================== --- trunk/test/test-parse-message.lisp (original) +++ trunk/test/test-parse-message.lisp Mon May 15 18:54:48 2006 @@ -11,6 +11,7 @@ (defvar *msg4* (format nil ":kire_!~~eenge@adsl-156-35-240.asm.bellsouth.net MODE #lisppaste +k key~A" #\Return)) (defvar *msg5* (format nil ":kire_!~~eenge@adsl-156-35-240.asm.bellsouth.net MODE #lisppaste +bbb *!*@somewhere.com *!*@somewhereles.com *!*@youdontwannaknow.org~A" #\Return)) (defvar *msg6* (format nil ":kire!~~eenge@216.248.178.227 PRIVMSG cl-irc heyhey!~A" #\Return)) +(defvar *msg7* (format nil ":ChanServ!ChanServ@services. MODE #lisppaste +o eh "))
(deftest find-reply-name.1 (irc:find-reply-name 1) :rpl_welcome) @@ -66,3 +67,7 @@ (deftest no-trailing.1 (irc::parse-raw-message *msg6*) "kire" "~eenge" "216.248.178.227" "PRIVMSG" ("cl-irc" "heyhey!")) + +(deftest mode.1 + (irc::parse-raw-message *msg7*) + "ChanServ" "ChanServ" "services." "MODE" ("#lisppaste" "+o" "eh"))
Modified: trunk/utility.lisp ============================================================================== --- trunk/utility.lisp (original) +++ trunk/utility.lisp Mon May 15 18:54:48 2006 @@ -146,7 +146,7 @@
(defun substring (string start &optional end) (let* ((end-index (if end end (length string))) - (seq-len (- end-index start))) + (seq-len (1- (- end-index start)))) (make-array seq-len :element-type (array-element-type string) :displaced-to string