diff options
| author | Jelmer Vernooij <jelmer@samba.org> | 2006-05-25 01:04:18 +0200 | 
|---|---|---|
| committer | Jelmer Vernooij <jelmer@samba.org> | 2006-05-25 01:04:18 +0200 | 
| commit | 601e81362bbf4e4d1e686334b35d3bdcd87314d2 (patch) | |
| tree | 53ed2250bfc35b9e8da568b6f624a530d323ef32 /help.c | |
| parent | 46ad029950221205d1eb6201ec2f01c7231876c2 (diff) | |
| parent | fc630f9fb47690c30feaf4738727a213d633afc9 (diff) | |
[merge] Wilmer
Diffstat (limited to 'help.c')
| -rw-r--r-- | help.c | 17 | 
1 files changed, 8 insertions, 9 deletions
| @@ -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;  } | 
