[Cl-irc-cvs] CVS update: cl-irc/utility.lisp

Andreas Fuchs afuchs at common-lisp.net
Mon Oct 3 14:11:04 UTC 2005


Update of /project/cl-irc/cvsroot/cl-irc
In directory common-lisp.net:/tmp/cvs-serv31157

Modified Files:
	utility.lisp 
Log Message:
fix parsing of mode args that contain #\+ or #\-, e.g. -o+b.

Date: Mon Oct  3 16:11:03 2005
Author: afuchs

Index: cl-irc/utility.lisp
diff -u cl-irc/utility.lisp:1.7 cl-irc/utility.lisp:1.8
--- cl-irc/utility.lisp:1.7	Sun Apr 17 21:45:42 2005
+++ cl-irc/utility.lisp	Mon Oct  3 16:11:02 2005
@@ -1,4 +1,4 @@
-;;;; $Id: utility.lisp,v 1.7 2005/04/17 19:45:42 ehuelsmann Exp $
+;;;; $Id: utility.lisp,v 1.8 2005/10/03 14:11:02 afuchs Exp $
 ;;;; $Source: /project/cl-irc/cvsroot/cl-irc/utility.lisp,v $
 
 ;;;; See the LICENSE file for licensing information.
@@ -319,18 +319,21 @@
             (unless (position this-op "+-")
               (throw 'illegal-mode-spec nil))
             (dotimes (i (length modes))
-              (let* ((mode-rec
-                      (mode-description connection target
-                                        (mode-name-from-char connection target
-                                                             (char modes i))))
-                     (param-p (funcall param-req mode-rec)))
-                (when (and param-p
-                           (= 0 (length arguments)))
-                  (throw 'illegal-mode-spec nil))
-                (push (list this-op
-                            (mode-desc-symbol mode-rec)
-                            (when param-p
-                              (if (mode-desc-nick-param-p mode-rec)
-                                  (find-user connection (pop arguments))
-                                (pop arguments)))) ops)))))))))
+              (case (char modes i)
+                ((#\+ #\-) (setf this-op (char modes i)))
+                (t 
+                 (let* ((mode-rec
+                         (mode-description connection target
+                                           (mode-name-from-char connection target
+                                                                (char modes i))))
+                        (param-p (funcall param-req mode-rec)))
+                   (when (and param-p
+                              (= 0 (length arguments)))
+                     (throw 'illegal-mode-spec nil))
+                   (push (list this-op
+                               (mode-desc-symbol mode-rec)
+                               (when param-p
+                                 (if (mode-desc-nick-param-p mode-rec)
+                                     (find-user connection (pop arguments))
+                                     (pop arguments)))) ops)))))))))))
 




More information about the cl-irc-cvs mailing list