]> git.pld-linux.org Git - packages/gammu.git/blame - gammu-etc_dir.patch
- updated to 1.22.1
[packages/gammu.git] / gammu-etc_dir.patch
CommitLineData
75c8dbd3
TP
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;
c66455df 9
75c8dbd3
TP
10 *result = NULL;
11@@ -988,14 +989,24 @@
12 /* Reset as we're using strcat */
13 configfile[0] = 0;
95bc37a0 14
75c8dbd3
TP
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.037256 seconds and 4 git commands to generate.