]> git.pld-linux.org Git - packages/gammu.git/blob - gammu-etc_dir.patch
- oops, readded missing path
[packages/gammu.git] / gammu-etc_dir.patch
1 --- gammu/common/gsmstate.c.orig        2008-12-16 14:11:54.000000000 +0100
2 +++ gammu/common/gsmstate.c     2008-12-21 13:59:48.000000000 +0100
3 @@ -971,6 +971,7 @@
4  {
5         char configfile[PATH_MAX + 1];
6         char *envpath;
7 +       char *home_etc;
8         GSM_Error error;
9  
10         *result = NULL;
11 @@ -988,14 +989,24 @@
12         /* Reset as we're using strcat */
13         configfile[0] = 0;
14  
15 +       /* Try user etc dir */
16 +       home_etc = getenv("HOME_ETC");
17 +       if (home_etc) {
18 +               strcat(configfile, home_etc);
19 +               strcat(configfile, GAMMURC_NAME);
20 +
21 +               error = GSM_TryReadGammuRC(configfile, result);
22 +               if (error == ERR_NONE) return ERR_NONE;
23 +       } else {
24         /* Try user home */
25 -       envpath  = getenv("HOME");
26 -       if (envpath) {
27 +           envpath  = getenv("HOME");
28 +           if (envpath) {
29                 strcat(configfile, envpath);
30                 strcat(configfile, GAMMURC_NAME);
31  
32                 error = GSM_TryReadGammuRC(configfile, result);
33                 if (error == ERR_NONE) return ERR_NONE;
34 +           }
35         }
36  
37  #if defined(WIN32)
This page took 0.059356 seconds and 3 git commands to generate.