aboutsummaryrefslogtreecommitdiffstats
path: root/help.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-07-06 00:39:47 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2007-07-06 00:39:47 +0100
commite90044208fc88636f843cdd188faa12e5db8c1c0 (patch)
tree1238997e7436af5192ce8e127a783d3d687a9ff4 /help.c
parent9da0bbfd42609f0f3864b5a16a3c1c378b7217c9 (diff)
parent19a8088455308088139d0b2f6a8d0d4fbf982b29 (diff)
Merging from devel. Added documentation for the join_chat command, adding
a debian/ tree and a merge from Jelmer (mainly unittest stuff).
Diffstat (limited to 'help.c')
-rw-r--r--help.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/help.c b/help.c
index 7c6d2dda..756eb12a 100644
--- a/help.c
+++ b/help.c
@@ -30,7 +30,7 @@
#define BUFSIZE 1100
-help_t *help_init( help_t **help )
+help_t *help_init( help_t **help, const char *helpfile )
{
int i, buflen = 0;
help_t *h;
@@ -40,7 +40,7 @@ help_t *help_init( help_t **help )
*help = h = g_new0 ( help_t, 1 );
- h->fd = open( global.helpfile, O_RDONLY
+ h->fd = open( helpfile, O_RDONLY
#ifdef _WIN32
| O_BINARY
#endif
@@ -108,12 +108,11 @@ char *help_get( help_t **help, char *string )
struct stat stat[1];
help_t *h;
- h=*help;
-
- while( h )
+ for( h = *help; h; h = h->next )
{
- if( g_strcasecmp( h->string, string ) == 0 ) break;
- h = h->next;
+ if( h->string != NULL &&
+ g_strcasecmp( h->string, string ) == 0 )
+ break;
}
if( h && h->length > 0 )
{