]> git.pld-linux.org Git - packages/gammu.git/blame - gammu-etc_dir.patch
- updated ETC_DIR to HOME_ETC
[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;
22133c47 7+ char *home_etc;
75c8dbd3 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 15+ /* Try user etc dir */
22133c47
TP
16+ home_etc = getenv("HOME_ETC");
17+ if (home_etc) {
18+ strcat(configfile, home_etc);
75c8dbd3
TP
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.119689 seconds and 4 git commands to generate.