]> git.pld-linux.org Git - packages/abook.git/blob - abook-home_etc.patch
- updated to 0.5.6
[packages/abook.git] / abook-home_etc.patch
1 diff -burN abook-0.5.4.orig/abook.c abook-0.5.4/abook.c
2 --- abook-0.5.4.orig/abook.c    2005-09-05 09:05:10.903458032 +0200
3 +++ abook-0.5.4/abook.c 2005-09-05 09:17:13.733571152 +0200
4 @@ -70,13 +70,15 @@
5  {
6         struct stat s;
7         char *dir;
8 +       char *home;
9  
10         assert(!is_ui_initialized());
11  
12         if(alternative_datafile)
13                 return;
14  
15 -       dir = strconcat(getenv("HOME"), "/" DIR_IN_HOME, NULL);
16 +       home = getenv("HOME_ETC") ? getenv("HOME_ETC") : getenv("HOME");
17 +       dir = strconcat(home, "/" DIR_IN_HOME, NULL);
18         assert(dir != NULL);
19  
20         if(stat(dir, &s) == -1) {
21 @@ -207,18 +209,21 @@
22  set_filenames()
23  {
24         struct stat s;
25 +       char * home;
26  
27         if( (stat(getenv("HOME"), &s)) == -1 || ! S_ISDIR(s.st_mode) ) {
28                 fprintf(stderr,_("%s is not a valid HOME directory\n"), getenv("HOME") );
29                 exit(EXIT_FAILURE);
30         }
31  
32 +       home = getenv("HOME_ETC") ? getenv("HOME_ETC") : getenv("HOME");
33 +
34         if(!datafile)
35 -               datafile = strconcat(getenv("HOME"), "/" DIR_IN_HOME "/"
36 +               datafile = strconcat(home, "/" DIR_IN_HOME "/"
37                                 DATAFILE, NULL);
38  
39         if(!rcfile)
40 -               rcfile = strconcat(getenv("HOME"), "/" DIR_IN_HOME "/"
41 +               rcfile = strconcat(home, "/" DIR_IN_HOME "/"
42                                 RCFILE, NULL);
43  
44         atexit(free_filenames);
This page took 0.097421 seconds and 3 git commands to generate.