]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Some fixes here
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 19 Apr 2004 22:50:38 +0000 (22:50 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 19 Apr 2004 22:50:38 +0000 (22:50 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@679 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_helpop.cpp

index 1a7968b7f1a3451c7df5caa88a974cf11ec99e87..2e30ae86a03e042d5c68545c30f9ebb778558c0b 100644 (file)
@@ -73,29 +73,28 @@ bool do_helpop(char **parameters, int pcnt, userrec *src)
        std::string output = " "; // a fix bought to you by brain :p
        char a[MAXBUF];
 
-       if (!parameters) { strcpy(search, "start"); }
-       else { search = parameters[0]; }
-
-       if (search[0] == '?') { search++; }
-
-       // Make sure it exists.
-       if (helpop->ReadValue(std::string(search), "line1", 0) == "")
-       {
-               // Tell caller..
-               return false;
-       }
+       if (!parameters) {
+               search = "start";
+       }
+       else {
+               search = parameters[0];
+       }
 
-       // Somethings there.. tell the person who wants to know :p
+       if (search[0] == '?') {
+               search++;
+       }
 
+       int nlines = 0;
        for (int i = 1; output != ""; i++)
        {
                snprintf(a,MAXBUF,"line%d",i);
                output = helpop->ReadValue(std::string(search), std::string(a), 0);
                if (output != "") {
                        Srv->SendTo(NULL,src,"290 "+std::string(src->nick)+" :"+output);
+                       nlines++;
                }
        }
-       return true;
+       return (nlines>0);
 }