aboutsummaryrefslogtreecommitdiffstats
path: root/help.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-24 16:16:38 +0100
committerJelmer Vernooij <jelmer@samba.org>2006-03-24 16:16:38 +0100
commit728a981e422539df38d27d87e33829082d376ac6 (patch)
tree86458693b4f0f38f3695ce7fe3bcc7b1ee67c818 /help.c
parent96ace1b808f4df3f2106fa90c19fdc23408f924d (diff)
parent9b8a38bfa9a89e9741521ac522927c80b68976cf (diff)
[merge] Wilmer
Diffstat (limited to 'help.c')
-rw-r--r--help.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/help.c b/help.c
index 8959a70b..7c6d2dda 100644
--- a/help.c
+++ b/help.c
@@ -115,22 +115,21 @@ char *help_get( help_t **help, char *string )
if( g_strcasecmp( h->string, string ) == 0 ) break;
h = h->next;
}
- if( h )
+ if( h && h->length > 0 )
{
char *s = g_new( char, h->length + 1 );
if( fstat( h->fd, stat ) != 0 )
{
g_free( h );
- *help=NULL;
- return( NULL );
+ *help = NULL;
+ return NULL;
}
mtime = stat->st_mtime;
- if( mtime > h->mtime ) {
- return( NULL );
- return( g_strdup( "Help file changed during this session. Please restart to get help back." ) );
- }
+ if( mtime > h->mtime )
+ return NULL;
+
s[h->length] = 0;
if( h->fd >= 0 )
{
@@ -141,8 +140,8 @@ char *help_get( help_t **help, char *string )
{
strncpy( s, h->offset.mem_offset, h->length );
}
- return( s );
+ return s;
}
- return( NULL );
+ return NULL;
}