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 *[]); |
122 |
|
static void |
123 |
|
dohelp(struct Client *source_p, const char *hpath, char *topic) |
124 |
|
{ |
125 |
+ |
char h_index[] = "index"; |
126 |
|
char path[PATH_MAX + 1]; |
127 |
|
struct stat sb; |
128 |
|
int i; |
130 |
|
if (topic != NULL) |
131 |
|
{ |
132 |
|
if (*topic == '\0') |
133 |
< |
topic = "index"; |
133 |
> |
topic = h_index; |
134 |
|
else |
135 |
|
{ |
136 |
|
/* convert to lower case */ |
137 |
< |
for (i = 0; topic[i] != '\0'; i++) |
137 |
> |
for (i = 0; topic[i] != '\0'; ++i) |
138 |
|
topic[i] = ToLower(topic[i]); |
139 |
|
} |
140 |
|
} |
141 |
|
else |
142 |
< |
topic = "index"; /* list available help topics */ |
142 |
> |
topic = h_index; /* list available help topics */ |
143 |
|
|
144 |
|
if (strpbrk(topic, "/\\")) |
145 |
|
{ |
165 |
|
return; |
166 |
|
} |
167 |
|
|
169 |
– |
#ifndef _WIN32 |
168 |
|
if (!S_ISREG(sb.st_mode)) |
169 |
|
{ |
170 |
|
ilog(L_NOTICE, "help file %s not found", path); |
172 |
|
me.name, source_p->name, topic); |
173 |
|
return; |
174 |
|
} |
177 |
– |
#endif |
175 |
|
|
176 |
|
sendhelpfile(source_p, path, topic); |
177 |
|
} |