]> git.pld-linux.org Git - packages/elmo.git/blob - elmo-etc_dir.patch
fix ncurses inludes s/\<ncurses\.h\>/\<ncurses\/ncurses\.h\>/
[packages/elmo.git] / elmo-etc_dir.patch
1 diff -Nru elmo-0.4/src/abook.c elmo-0.4.new/src/abook.c
2 --- elmo-0.4/src/abook.c        Thu Mar 13 20:51:32 2003
3 +++ elmo-0.4.new/src/abook.c    Sat Mar 29 07:34:33 2003
4 @@ -194,8 +194,14 @@
5    FILE *fp;
6  
7    afile = cf_txtvar_lookup ("addressbook");
8 -  if (afile == NULL)
9 -    afile = file_with_dir (getenv ("HOME"), ".addressbook");
10 +  if (afile == NULL) {
11 +    char *etc_dir = getenv("ETC_DIR");
12 +    
13 +    if (etc_dir)
14 +      afile = file_with_dir (etc_dir, "addressbook");
15 +    else
16 +      afile = file_with_dir (getenv ("HOME"), ".addressbook");
17 +  }
18    else
19      afile = xstrdup (afile);
20    
21 diff -Nru elmo-0.4/src/confread.c elmo-0.4.new/src/confread.c
22 --- elmo-0.4/src/confread.c     Mon Mar 17 08:24:02 2003
23 +++ elmo-0.4.new/src/confread.c Sat Mar 29 07:31:40 2003
24 @@ -53,6 +53,7 @@
25  #define BUFFER_SIZE 128
26  
27  #define CONF_FILE ".elmorc"
28 +#define ETC_DIR_CONF_FILE "elmorc"
29  
30  enum type_t {TYPE_TXT, TYPE_NUM};
31  
32 @@ -272,8 +273,14 @@
33    conf_table  = htable_create (size);
34    initialized = 1;
35  
36 -  if (config_file == NULL)
37 -    file = file_with_dir (getenv ("HOME"), CONF_FILE);
38 +  if (config_file == NULL){
39 +    char *etc_dir = getenv("ETC_DIR");
40 +    
41 +    if (etc_dir)
42 +      file = file_with_dir (etc_dir, ETC_DIR_CONF_FILE);
43 +    else
44 +      file = file_with_dir (getenv ("HOME"), CONF_FILE);
45 +  }
46    else
47      file = xstrdup (config_file);
48    cf_read_file (file);
This page took 0.048176 seconds and 3 git commands to generate.