--- gammu-1.28.92/libgammu/gsmstate.c~ 2010-10-04 15:28:55.000000000 +0200 +++ gammu-1.28.92/libgammu/gsmstate.c 2010-10-05 11:15:22.047837669 +0200 @@ -1085,6 +1085,7 @@ { char configfile[PATH_MAX + 1]; char *envpath; + char *home_etc; GSM_Error error; #if defined(HAVE_GETPWUID) && defined(HAVE_GETUID) struct passwd *pwent; @@ -1126,6 +1127,16 @@ } } + /* Try user etc dir */ + home_etc = getenv("HOME_ETC"); + if (home_etc) { + strcat(configfile, home_etc); + strcat(configfile, GAMMURC_NAME); + + error = GSM_TryReadGammuRC(configfile, result); + if (error == ERR_NONE) return ERR_NONE; + } else { + /* Try home from environment */ envpath = getenv("HOME"); if (envpath) { @@ -1135,6 +1146,7 @@ error = GSM_TryReadGammuRC(configfile, result); if (error == ERR_NONE) return ERR_NONE; } + } #if defined(HAVE_GETPWUID) && defined(HAVE_GETUID) /* Tru home from passwd */