]> git.pld-linux.org Git - packages/gammu.git/blob - gammu-etc_dir.patch
49edb0a84abfcf092a74674af1e47ebb30b37a60
[packages/gammu.git] / gammu-etc_dir.patch
1 --- gsmstate.c.orig     2008-12-16 14:11:54.000000000 +0100
2 +++ 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 *etc_dir;
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 +       etc_dir = getenv("ETC_DIR");
17 +       if (etc_dir) {
18 +               strcat(configfile, etc_dir);
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.029498 seconds and 2 git commands to generate.