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/modules/m_help.c (file contents):
Revision 32 by knight, Sun Oct 2 20:41:23 2005 UTC vs.
Revision 1155 by michael, Tue Aug 9 20:27:45 2011 UTC

# Line 36 | Line 36
36   #include "modules.h"
37   #include "irc_string.h"
38  
39 #define HPATH  IRCD_PREFIX "/help/opers"
40 #define UHPATH IRCD_PREFIX "/help/users"
39   #define HELPLEN 400
40  
41   static void m_help(struct Client *, struct Client *, int, char *[]);
# Line 56 | Line 54 | struct Message uhelp_msgtab = {
54    {m_unregistered, m_help, m_ignore, m_ignore, mo_uhelp, m_ignore}
55   };
56  
59 #ifndef STATIC_MODULES
57   void
58   _modinit(void)
59   {
# Line 72 | Line 69 | _moddeinit(void)
69   }
70  
71   const char *_version = "$Revision$";
75 #endif
72  
73   /*
74   * m_help - HELP message handler
# Line 124 | Line 120 | mo_uhelp(struct Client *client_p, struct
120   static void
121   dohelp(struct Client *source_p, const char *hpath, char *topic)
122   {
123 +  char h_index[] = "index";
124    char path[PATH_MAX + 1];
125    struct stat sb;
126    int i;
# Line 131 | Line 128 | dohelp(struct Client *source_p, const ch
128    if (topic != NULL)
129    {
130      if (*topic == '\0')
131 <      topic = "index";
131 >      topic = h_index;
132      else
133      {
134        /* convert to lower case */
135 <      for (i = 0; topic[i] != '\0'; i++)
135 >      for (i = 0; topic[i] != '\0'; ++i)
136          topic[i] = ToLower(topic[i]);
137      }
138    }
139    else
140 <    topic = "index"; /* list available help topics */
140 >    topic = h_index;    /* list available help topics */
141  
142    if (strpbrk(topic, "/\\"))
143    {
# Line 160 | Line 157 | dohelp(struct Client *source_p, const ch
157  
158    if (stat(path, &sb) < 0)
159    {
163    ilog(L_NOTICE, "help file %s not found", path);
160      sendto_one(source_p, form_str(ERR_HELPNOTFOUND),
161                 me.name, source_p->name, topic);
162      return;
163    }
164  
169 #ifndef _WIN32
165    if (!S_ISREG(sb.st_mode))
166    {
172    ilog(L_NOTICE, "help file %s not found", path);
167      sendto_one(source_p, form_str(ERR_HELPNOTFOUND),
168                 me.name, source_p->name, topic);
169      return;
170    }
177 #endif
171  
172    sendhelpfile(source_p, path, topic);
173   }
# Line 212 | Line 205 | sendhelpfile(struct Client *source_p, co
205    while (fbgets(line, sizeof(line), file))
206    {
207      line[strlen(line) - 1] = '\0';
208 <    if(line[0] != '#')
208 >    if (line[0] != '#')
209      {
210        if (!started)
211        {
212          type = RPL_HELPSTART;
213 <        started = 1;
213 >        started = 1;
214        }
215        else
216          type = RPL_HELPTXT;

Comparing ircd-hybrid/modules/m_help.c (property svn:keywords):
Revision 32 by knight, Sun Oct 2 20:41:23 2005 UTC vs.
Revision 1155 by michael, Tue Aug 9 20:27:45 2011 UTC

# Line 1 | Line 1
1 < Revision
1 > Id Revision

Diff Legend

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