]> git.pld-linux.org Git - packages/dc_gui.git/commitdiff
- home_etc patch
authorpascalek <pascalek@pld-linux.org>
Mon, 3 Jun 2002 09:18:32 +0000 (09:18 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dc_gui-home_etc.patch -> 1.1

dc_gui-home_etc.patch [new file with mode: 0644]

diff --git a/dc_gui-home_etc.patch b/dc_gui-home_etc.patch
new file mode 100644 (file)
index 0000000..11f1e78
--- /dev/null
@@ -0,0 +1,96 @@
+diff -Nur dc_gui-0.57.orig/src/callbacks.c dc_gui-0.57.chng/src/callbacks.c
+--- dc_gui-0.57.orig/src/callbacks.c   Sat May 25 10:51:21 2002
++++ dc_gui-0.57.chng/src/callbacks.c   Mon Jun  3 10:57:40 2002
+@@ -2894,14 +2894,21 @@
+ on_clear_recent_list_button_clicked    (GtkButton       *button,
+                                         gpointer         user_data)
+ {
+-      GString *s;
+       char *path;
+-      s=g_string_new(NULL);
+-      path=getenv("HOME");
+-      g_string_sprintf(s,"%s/.dctc/recent",(path!=NULL)?path:".");
+-      unlink(s->str);
+-      g_string_free(s,TRUE);
++      path = getenv("HOME");  
++      if (!path)
++          path = ".";
++
++      if(getenv("CONFIG_DIR"))
++          path = g_strconcat(path, "/", getenv("CONFIG_DIR"), 
++              "/dctc/recent", NULL);
++      else
++          path = g_strconcat(path, "/.dctc/recent", NULL);
++
++      unlink(path);   
++      g_free(path);
++
+       fill_recent_hub_clist();
+ }
+diff -Nur dc_gui-0.57.orig/src/init_fnc.c dc_gui-0.57.chng/src/init_fnc.c
+--- dc_gui-0.57.orig/src/init_fnc.c    Sat May 25 11:01:34 2002
++++ dc_gui-0.57.chng/src/init_fnc.c    Mon Jun  3 11:01:10 2002
+@@ -341,19 +341,25 @@
+       if(rhcw)
+       {
+               FILE *f;
+-              GString *s;
+               char *path;
+               gtk_clist_freeze(GTK_CLIST(rhcw));
+               gtk_clist_clear(GTK_CLIST(rhcw));
+               gtk_clist_set_auto_sort(GTK_CLIST(rhcw),TRUE);
+-              s=g_string_new(NULL);
+-              path=getenv("HOME");
+-              g_string_sprintf(s,"%s/.dctc/recent",(path!=NULL)?path:".");
++              path = getenv("HOME");
++              if (!path)
++                  path = ".";
++
++              if(getenv("CONFIG_DIR"))
++                  path = g_strconcat(path, "/", getenv("CONFIG_DIR"), 
++                      "/dctc/recent", NULL);
++              else
++                  path = g_strconcat(path, "/.dctc/recent", NULL);
+               /* we read the file ~/.dctc/recent */
+-              f=fopen(s->str,"rb");
++              f=fopen(path, "rb");
++              g_free(path);
+               if(f!=NULL)
+               {
+                       char *ent[4];
+@@ -412,7 +418,6 @@
+                       fclose(f);
+               }
+-              g_string_free(s,TRUE);
+               gtk_clist_sort(GTK_CLIST(rhcw));
+               gtk_clist_thaw(GTK_CLIST(rhcw));
+       }
+diff -Nur dc_gui-0.57.orig/src/main.c dc_gui-0.57.chng/src/main.c
+--- dc_gui-0.57.orig/src/main.c        Sat May 18 15:11:19 2002
++++ dc_gui-0.57.chng/src/main.c        Mon Jun  3 11:02:54 2002
+@@ -265,8 +265,17 @@
+ #endif
+       path=getenv("HOME");
+-      dctc_main_dir=g_string_new(NULL);
+-      g_string_sprintf(dctc_main_dir,"%s/.dctc",(path!=NULL)?path:".");
++      if (!path)
++          path = ".";
++
++      if(getenv("CONFIG_DIR"))
++          path = g_strconcat(path, "/", getenv("CONFIG_DIR"), 
++              "/dctc", NULL);
++      else
++          path = g_strconcat(path, "/.dctc", NULL);
++      
++      dctc_main_dir=g_string_new(path);
++      g_free(path);
+       if(access(dctc_main_dir->str,R_OK|W_OK|X_OK))
+       {
+               if(errno==ENOENT)
This page took 0.101487 seconds and 4 git commands to generate.