ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_help.c
(Generate patch)

Comparing ircd-hybrid/trunk/modules/m_help.c (file contents):
Revision 1592 by michael, Sat Oct 27 21:02:32 2012 UTC vs.
Revision 1674 by michael, Fri Nov 23 21:00:02 2012 UTC

# Line 91 | Line 91 | dohelp(struct Client *source_p, const ch
91    char h_index[] = "index";
92    char path[PATH_MAX + 1];
93    struct stat sb;
94 <  int i;
94 >  unsigned int i;
95  
96 <  if (topic != NULL)
97 <  {
98 <    if (*topic == '\0')
99 <      topic = h_index;
100 <    else
101 <    {
102 <      /* convert to lower case */
103 <      for (i = 0; topic[i] != '\0'; ++i)
104 <        topic[i] = ToLower(topic[i]);
105 <    }
106 <  }
96 >  if (EmptyString(topic))
97 >    topic = h_index;
98    else
99 <    topic = h_index;    /* list available help topics */
99 >    for (i = 0; topic[i] != '\0'; ++i)
100 >      topic[i] = ToLower(topic[i]);
101  
102    if (strpbrk(topic, "/\\"))
103    {
# Line 145 | Line 137 | sendhelpfile(struct Client *source_p, co
137   {
138    FILE *file;
139    char line[HELPLEN];
148  char started = 0;
149  int type;
140  
141    if ((file = fopen(path, "r")) == NULL)
142    {
# Line 162 | Line 152 | sendhelpfile(struct Client *source_p, co
152      return;
153    }
154  
155 <  else if (line[0] != '#')
156 <  {
167 <    line[strlen(line) - 1] = '\0';        
168 <    sendto_one(source_p, form_str(RPL_HELPSTART),
155 >  line[strlen(line) - 1] = '\0';
156 >  sendto_one(source_p, form_str(RPL_HELPSTART),
157               me.name, source_p->name, topic, line);
170    started = 1;
171  }
158  
159    while (fgets(line, sizeof(line), file))
160    {
161      line[strlen(line) - 1] = '\0';
162 <    if (line[0] != '#')
163 <    {
164 <      if (!started)
179 <      {
180 <        type = RPL_HELPSTART;
181 <        started = 1;
182 <      }
183 <      else
184 <        type = RPL_HELPTXT;
185 <      
186 <      sendto_one(source_p, form_str(RPL_HELPTXT),
187 <                 me.name, source_p->name, topic, line);
188 <    }
162 >
163 >    sendto_one(source_p, form_str(RPL_HELPTXT),
164 >               me.name, source_p->name, topic, line);
165    }
166  
167    fclose(file);
192  sendto_one(source_p, form_str(RPL_HELPTXT),
193             me.name, source_p->name, topic, "");
168    sendto_one(source_p, form_str(RPL_ENDOFHELP),
169               me.name, source_p->name, topic);
170   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)