]>
Commit | Line | Data |
---|---|---|
fc825d2b | 1 | diff -Nur dc_gui-0.57.orig/src/callbacks.c dc_gui-0.57.chng/src/callbacks.c |
2 | --- dc_gui-0.57.orig/src/callbacks.c Sat May 25 10:51:21 2002 | |
3 | +++ dc_gui-0.57.chng/src/callbacks.c Mon Jun 3 10:57:40 2002 | |
4 | @@ -2894,14 +2894,21 @@ | |
5 | on_clear_recent_list_button_clicked (GtkButton *button, | |
6 | gpointer user_data) | |
7 | { | |
8 | - GString *s; | |
9 | char *path; | |
10 | ||
11 | - s=g_string_new(NULL); | |
12 | - path=getenv("HOME"); | |
13 | - g_string_sprintf(s,"%s/.dctc/recent",(path!=NULL)?path:"."); | |
14 | - unlink(s->str); | |
15 | - g_string_free(s,TRUE); | |
16 | + path = getenv("HOME"); | |
17 | + if (!path) | |
18 | + path = "."; | |
19 | + | |
20 | + if(getenv("CONFIG_DIR")) | |
21 | + path = g_strconcat(path, "/", getenv("CONFIG_DIR"), | |
22 | + "/dctc/recent", NULL); | |
23 | + else | |
24 | + path = g_strconcat(path, "/.dctc/recent", NULL); | |
25 | + | |
26 | + unlink(path); | |
27 | + g_free(path); | |
28 | + | |
29 | fill_recent_hub_clist(); | |
30 | } | |
31 | ||
32 | diff -Nur dc_gui-0.57.orig/src/init_fnc.c dc_gui-0.57.chng/src/init_fnc.c | |
33 | --- dc_gui-0.57.orig/src/init_fnc.c Sat May 25 11:01:34 2002 | |
34 | +++ dc_gui-0.57.chng/src/init_fnc.c Mon Jun 3 11:01:10 2002 | |
35 | @@ -341,19 +341,25 @@ | |
36 | if(rhcw) | |
37 | { | |
38 | FILE *f; | |
39 | - GString *s; | |
40 | char *path; | |
41 | ||
42 | gtk_clist_freeze(GTK_CLIST(rhcw)); | |
43 | gtk_clist_clear(GTK_CLIST(rhcw)); | |
44 | gtk_clist_set_auto_sort(GTK_CLIST(rhcw),TRUE); | |
45 | ||
46 | - s=g_string_new(NULL); | |
47 | - path=getenv("HOME"); | |
48 | - g_string_sprintf(s,"%s/.dctc/recent",(path!=NULL)?path:"."); | |
49 | + path = getenv("HOME"); | |
50 | + if (!path) | |
51 | + path = "."; | |
52 | + | |
53 | + if(getenv("CONFIG_DIR")) | |
54 | + path = g_strconcat(path, "/", getenv("CONFIG_DIR"), | |
55 | + "/dctc/recent", NULL); | |
56 | + else | |
57 | + path = g_strconcat(path, "/.dctc/recent", NULL); | |
58 | ||
59 | /* we read the file ~/.dctc/recent */ | |
60 | - f=fopen(s->str,"rb"); | |
61 | + f=fopen(path, "rb"); | |
62 | + g_free(path); | |
63 | if(f!=NULL) | |
64 | { | |
65 | char *ent[4]; | |
66 | @@ -412,7 +418,6 @@ | |
67 | ||
68 | fclose(f); | |
69 | } | |
70 | - g_string_free(s,TRUE); | |
71 | gtk_clist_sort(GTK_CLIST(rhcw)); | |
72 | gtk_clist_thaw(GTK_CLIST(rhcw)); | |
73 | } | |
74 | diff -Nur dc_gui-0.57.orig/src/main.c dc_gui-0.57.chng/src/main.c | |
75 | --- dc_gui-0.57.orig/src/main.c Sat May 18 15:11:19 2002 | |
76 | +++ dc_gui-0.57.chng/src/main.c Mon Jun 3 11:02:54 2002 | |
77 | @@ -265,8 +265,17 @@ | |
78 | #endif | |
79 | ||
80 | path=getenv("HOME"); | |
81 | - dctc_main_dir=g_string_new(NULL); | |
82 | - g_string_sprintf(dctc_main_dir,"%s/.dctc",(path!=NULL)?path:"."); | |
83 | + if (!path) | |
84 | + path = "."; | |
85 | + | |
86 | + if(getenv("CONFIG_DIR")) | |
87 | + path = g_strconcat(path, "/", getenv("CONFIG_DIR"), | |
88 | + "/dctc", NULL); | |
89 | + else | |
90 | + path = g_strconcat(path, "/.dctc", NULL); | |
91 | + | |
92 | + dctc_main_dir=g_string_new(path); | |
93 | + g_free(path); | |
94 | if(access(dctc_main_dir->str,R_OK|W_OK|X_OK)) | |
95 | { | |
96 | if(errno==ENOENT) |