~ubuntu-branches/ubuntu/wily/libuser/wily

« back to all changes in this revision

Viewing changes to lib/scache.c

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Habouzit
  • Date: 2006-09-03 21:58:15 UTC
  • mto: (2.1.1 edgy) (1.1.5 upstream) (3.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20060903215815-rtvvfzhaer8ymyp4
Tags: upstream-0.54.6-2.1.dfsg.1
ImportĀ upstreamĀ versionĀ 0.54.6-2.1.dfsg.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
16
 */
17
17
 
18
 
#ident "$Id: scache.c,v 1.6 2005/09/12 23:24:37 mitr Exp $"
 
18
#ident "$Id: scache.c,v 1.8 2006/01/31 00:22:40 mitr Exp $"
19
19
 
20
20
#ifdef HAVE_CONFIG_H
21
21
#include "../config.h"
27
27
static char *
28
28
lu_string_cache_cache(struct lu_string_cache *cache, const char *string)
29
29
{
30
 
        char *ret = NULL;
 
30
        char *ret;
 
31
 
31
32
        if (string == NULL) {
32
33
                return NULL;
33
34
        }
41
42
static int
42
43
get_keys(gpointer key, gpointer value, gpointer data)
43
44
{
 
45
        GList **list = data;
44
46
        (void)value;
45
 
        GList **list = data;
46
47
        if (key) {
47
48
                *list = g_list_append(*list, key);
48
49
        }
53
54
lu_string_cache_free(struct lu_string_cache *cache)
54
55
{
55
56
        GList *list = NULL, *i;
56
 
        char *tmp;
57
57
 
58
58
        g_return_if_fail(cache != NULL);
59
59
        g_tree_foreach(cache->tree, get_keys, &list);
60
60
        g_tree_destroy(cache->tree);
61
61
 
62
62
        for (i = list; i; i = g_list_next(i)) {
 
63
                char *tmp;
 
64
 
63
65
                if ((tmp = i->data) != NULL) {
64
66
                        memset(tmp, '\0', strlen(tmp));
65
67
                        g_free(tmp);