Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 340343 | Differences between
and this patch

Collapse All | Expand All

(-)megaglest-source-3.5.0_old/source/glest_game/main/main.cpp (+11 lines)
Lines 1957-1962 Link Here
1957
}
1957
}
1958
1958
1959
int glestMain(int argc, char** argv) {
1959
int glestMain(int argc, char** argv) {
1960
    if (!getenv("HOME"))
1961
    throw runtime_error("HOME external variable is not set");
1962
  
1963
    char path[PATH_MAX];
1964
    snprintf(path, PATH_MAX, "%s/.megaglest", getenv("HOME"));
1965
    mkdir(path, 0750);
1966
 
1967
    snprintf(path, PATH_MAX, "%s/.megaglest/screens", getenv("HOME"));
1968
    mkdir(path, 0750);
1969
    
1970
    chdir("@GENTOO_DATADIR@");
1960
#ifdef SL_LEAK_DUMP
1971
#ifdef SL_LEAK_DUMP
1961
	AllocRegistry memoryLeaks = AllocRegistry::getInstance();
1972
	AllocRegistry memoryLeaks = AllocRegistry::getInstance();
1962
#endif
1973
#endif
(-)megaglest-source-3.5.0_old/source/shared_lib/sources/util/leak_dumper.cpp (-1 / +3 lines)
Lines 43-49 Link Here
43
43
44
AllocRegistry::~AllocRegistry(){
44
AllocRegistry::~AllocRegistry(){
45
45
46
	dump("leak_dump.log");
46
	char path[PATH_MAX];
47
	snprintf(path, PATH_MAX, "%s/.megaglest/leak_dump.log", getenv("HOME"));
48
	dump(path);
47
}
49
}
48
50
49
void AllocRegistry::allocate(AllocInfo info){
51
void AllocRegistry::allocate(AllocInfo info){
(-)megaglest-source-3.5.0_old/source/shared_lib/sources/util/profiler.cpp (-2 / +4 lines)
Lines 83-91 Link Here
83
        }
83
        }
84
        profileLog = userData + profileLog;
84
        profileLog = userData + profileLog;
85
    }
85
    }
86
	FILE *f= fopen(profileLog.c_str(), "w");
86
	char path[PATH_MAX];
87
	snprintf(path, PATH_MAX, "%s/.magaglest/profiler.log", getenv("HOME"));
88
	FILE *f= fopen(path, "w");
87
	if(f==NULL)
89
	if(f==NULL)
88
		throw runtime_error("Can not open file: " + profileLog);
90
		throw runtime_error("Can not open file: %s",path);
89
91
90
	fprintf(f, "Profiler Results\n\n");
92
	fprintf(f, "Profiler Results\n\n");
91
93
(-)megaglest-source-3.5.0_old/source/shared_lib/sources/util/properties.cpp (-2 / +5 lines)
Lines 14-20 Link Here
14
#include <fstream>
14
#include <fstream>
15
#include <stdexcept>
15
#include <stdexcept>
16
#include <cstring>
16
#include <cstring>
17
17
#include <limits.h>
18
#include <stdlib.h>
18
#include "conversion.h"
19
#include "conversion.h"
19
#include "util.h"
20
#include "util.h"
20
#include "platform_common.h"
21
#include "platform_common.h"
Lines 147-153 Link Here
147
void Properties::save(const string &path){
148
void Properties::save(const string &path){
148
	ofstream fileStream;
149
	ofstream fileStream;
149
150
150
	fileStream.open(path.c_str(), ios_base::out | ios_base::trunc);
151
	char str[PATH_MAX];
152
	snprintf(str, PATH_MAX, "%s/.megaglest/%s", getenv("HOME"), path.c_str());
153
	fileStream.open(str, ios_base::out | ios_base::trunc);
151
154
152
	fileStream << "; === propertyMap File === \n";
155
	fileStream << "; === propertyMap File === \n";
153
	fileStream << '\n';
156
	fileStream << '\n';

Return to bug 340343