--- ircd-hybrid-6.0/src/channel.c.orig	Tue Feb 13 23:34:29 2001
+++ ircd-hybrid-6.0/src/channel.c	Tue Feb 13 23:34:09 2001
@@ -1097,8 +1097,6 @@
  */
 
 #define SM_ERR_NOTS             0x00000001      /* No TS on channel */
-#define SM_ERR_NOOPS            0x00000002      /* No chan ops */
-#define SM_ERR_UNKNOWN          0x00000004
 #define SM_ERR_RPL_C            0x00000008
 #define SM_ERR_RPL_B            0x00000010
 #define SM_ERR_RPL_E            0x00000020
@@ -1322,10 +1320,10 @@
 
           if (!isok)
             {
-              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name, 
                            sptr->name, chptr->chname);
-              break;
+                return;
             }
 
           /* Immune users */
@@ -1393,10 +1391,10 @@
 
           if (!isok)
             {
-              if (!errsent(SM_ERR_NOOPS, &errors_sent) && MyClient(sptr))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name, 
                            sptr->name, chptr->chname);
-              break;
+                return;
             }
 
 #ifdef OLD_MODE_K
@@ -1526,11 +1524,11 @@
 
           if (!isok)
             {
-              if (!errsent(SM_ERR_NOOPS, &errors_sent) && MyClient(sptr))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED),
                            me.name, sptr->name, 
                            chptr->chname);
-              break;
+                return;
             }
           
           if(MyClient(sptr))
@@ -1623,11 +1621,11 @@
 
           if (!isok)
             {
-              if (!errsent(SM_ERR_NOOPS, &errors_sent) && MyClient(sptr))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED),
                            me.name, sptr->name, 
                            chptr->chname);
-              break;
+                return;
             }
           
           if(MyClient(sptr))
@@ -1729,11 +1727,11 @@
 
           if (!isok)
             {
-              if (!errsent(SM_ERR_NOOPS, &errors_sent) && MyClient(sptr))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED),
                            me.name, sptr->name, 
                            chptr->chname);
-              break;
+                return;
             }
 
 
@@ -1854,10 +1852,10 @@
             break;
           if (!isok)
             {
-              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name, 
                            sptr->name, chptr->chname);
-              break;
+                return;
             }
 
           if(MyClient(sptr))
@@ -1941,10 +1939,10 @@
         case 'm' :
           if (!isok)
             {
-              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name, 
                            sptr->name, chptr->chname);
-              break;
+                return;
             }
 
           if(MyClient(sptr))
@@ -1993,10 +1991,10 @@
         case 'n' :
           if (!isok)
             {
-              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name, 
                            sptr->name, chptr->chname);
-              break;
+                return;
             }
 
           if(MyClient(sptr))
@@ -2045,10 +2043,10 @@
         case 'p' :
           if (!isok)
             {
-              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name, 
                            sptr->name, chptr->chname);
-              break;
+                return;
             }
 
           if(MyClient(sptr))
@@ -2094,10 +2092,10 @@
         case 's' :
           if (!isok)
             {
-              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name, 
                            sptr->name, chptr->chname);
-              break;
+                return;
             }
 
           /* ickity poo, traditional +p-s nonsense */
@@ -2154,10 +2152,10 @@
         case 't' :
           if (!isok)
             {
-              if (MyClient(sptr) && !errsent(SM_ERR_NOOPS, &errors_sent))
+              if (MyClient(sptr))
                 sendto_one(sptr, form_str(ERR_CHANOPRIVSNEEDED), me.name, 
                            sptr->name, chptr->chname);
-              break;
+                return;
             }
 
           if(MyClient(sptr))
@@ -2210,10 +2208,14 @@
           /* only one "UNKNOWNMODE" per mode... we don't want
           ** to generate a storm, even if it's just to a 
           ** local client  -orabidoo
+          ** Instead of the cute hackery you can just abort the mode
+          ** command entirely on the first error.. this has the advangage 
+          ** of not garbling the channel modes on typo.
+          ** 	-InnerFIRE
           */
-          if (MyClient(sptr) && !errsent(SM_ERR_UNKNOWN, &errors_sent))
+          if (MyClient(sptr))
             sendto_one(sptr, form_str(ERR_UNKNOWNMODE), me.name, sptr->name, c);
-          break;
+            return;
         }
     }
 
