Changeset 8e9e2b7 for help.c


Ignore:
Timestamp:
2010-10-03T02:45:26Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
04f0c10
Parents:
88de0c9 (diff), 2af3e23 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging mainline, which includes a huge msnp13 merge.

Not 100% sure about the OpenSSL merge, should double check that but I'm
currently offline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • help.c

    r88de0c9 r8e9e2b7  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2009 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2010 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    2626#define BITLBEE_CORE
    2727#include "bitlbee.h"
     28#include "help.h"
    2829#undef read
    2930#undef write
     
    157158                        }
    158159                       
    159                         lseek( h->fd, h->offset.file_offset, SEEK_SET );
    160                         read( h->fd, s, h->length );
     160                        if( lseek( h->fd, h->offset.file_offset, SEEK_SET ) == -1 ||
     161                            read( h->fd, s, h->length ) != h->length )
     162                                return NULL;
    161163                }
    162164                else
     
    193195        return 1;
    194196}
     197
     198char *help_get_whatsnew( help_t **help, int old )
     199{
     200        GString *ret = NULL;
     201        help_t *h;
     202        int v;
     203       
     204        for( h = *help; h; h = h->next )
     205                if( h->title != NULL && strncmp( h->title, "whatsnew", 8 ) == 0 &&
     206                    sscanf( h->title + 8, "%x", &v ) == 1 && v > old )
     207                {
     208                        char *s = help_get( &h, h->title );
     209                        if( ret == NULL )
     210                                ret = g_string_new( s );
     211                        else
     212                                g_string_append_printf( ret, "\n\n%s", s );
     213                        g_free( s );
     214                }
     215       
     216        return ret ? g_string_free( ret, FALSE ) : NULL;
     217}
Note: See TracChangeset for help on using the changeset viewer.