1 --- vodovod-1.05.orig/config.cpp
2 +++ vodovod-1.05/config.cpp
11 //------------------------------------------------------------------------------
14 //-----------------------------------------------------------------------------
17 - std::ofstream file("vodovod.conf");
18 + char vodovod_conf[PATH_MAX] = "vodovod.conf";
21 + char *home = getenv("HOME");
24 + snprintf(vodovod_conf, sizeof(vodovod_conf), "%s/.vodovod", home);
25 + mkdir(vodovod_conf, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
27 + strncat(vodovod_conf, "/vodovod.conf", sizeof(vodovod_conf));
30 + std::ofstream file(vodovod_conf);
35 // this gets called from main() so we're sure config.ini is in the right place
38 - std::ifstream file("vodovod.conf");
39 + char vodovod_conf[PATH_MAX] = "vodovod.conf";
42 + char *home = getenv("HOME");
44 + snprintf(vodovod_conf, sizeof(vodovod_conf), "%s/.vodovod/vodovod.conf", home);
47 + std::ifstream file(vodovod_conf);
51 --- vodovod-1.05.orig/hiscore.cpp
52 +++ vodovod-1.05/hiscore.cpp
54 along with Vodovod in file COPYING; if not, write to the Free Software
55 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56 -----------------------------------------------------------------------------*/
60 +#include <sys/stat.h>
62 //-----------------------------------------------------------------------------
65 //-----------------------------------------------------------------------------
68 + char hiscore_dat[PATH_MAX] = "hiscore.dat";
71 + char *home = getenv("HOME");
74 + snprintf(hiscore_dat, sizeof(hiscore_dat), "%s/.vodovod", home);
75 + mkdir(hiscore_dat, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
77 + strncat(hiscore_dat, "/hiscore.dat", sizeof(hiscore_dat));
81 // format: NAME#POINTS#SWAPS#
82 - FILE *fp = fopen("hiscore.dat", "w+");
83 + FILE *fp = fopen(hiscore_dat, "w+");
86 for (iterator it = begin(); it != end(); ++it)