1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
$NetBSD: patch-ab,v 1.1 2004/03/10 19:31:06 jmmv Exp $
--- libgtodo/libgtodo.c.orig 2004-02-15 22:03:09.000000000 +0100
+++ libgtodo/libgtodo.c
@@ -770,10 +770,10 @@ int gtodo_client_reload(GTodoClient *cl)
GTodoClient * gtodo_client_new_default(GError **error)
{
GError *tmp_error = NULL;
+ GTodoClient *cl = NULL;
/* check if the error is good or wrong. */
g_return_val_if_fail(error == NULL || *error == NULL,FALSE);
- GTodoClient *cl = NULL;
cl = g_malloc(sizeof(GTodoClient));
cl->xml_path = g_strdup_printf("file:///%s/.gtodo/todos", g_getenv("HOME"));
/* check, open or create the correct xml file */
@@ -793,6 +793,7 @@ GTodoClient * gtodo_client_new_default(G
GTodoClient * gtodo_client_new_from_file(char *filename, GError **error)
{
GError *tmp_error = NULL;
+ GTodoClient *cl = NULL;
/* check if the error is good or wrong. */
g_return_val_if_fail(error == NULL || *error == NULL,FALSE);
if(debug)g_print("Trying to create a new client %s\n", filename);
@@ -802,7 +803,6 @@ GTodoClient * gtodo_client_new_from_file
g_propagate_error(error, tmp_error);
return NULL;
}
- GTodoClient *cl = NULL;
cl = g_malloc(sizeof(GTodoClient));
cl->xml_path = g_strdup(filename);
/* check, open or create the correct xml file */
@@ -833,11 +833,11 @@ GTodoList * gtodo_client_get_category_li
{
xmlNodePtr cur;
GTodoList *list = g_malloc(sizeof(GTodoList));
- list->list = NULL;
+ GTodoCategory *cat;
int repos = 0;
+ list->list = NULL;
cl->number_of_categories = 0;
cur = cl->root->xmlChildrenNode;
- GTodoCategory *cat;
while(cur != NULL){
if(xmlStrEqual(cur->name, (const xmlChar *)"category")){
|