You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/games-arcade/tomatoes/files/tomatoes-1.55-c_str.patch

25 lines
500 B

--- a/src/config.cpp
+++ b/src/config.cpp
@@ -78,6 +78,7 @@
// makefile.
char *get_config_location(bool write) {
#ifdef LINUX
+ static char *config_path = NULL;
// Get the path to the config file
string tmp = get_tomatoes_dir() + "config.cfg";
@@ -90,8 +91,11 @@
}
fclose(ftest);
}
-
- return (char*)tmp.c_str();
+ if (!config_path) {
+ config_path = new char[tmp.length()+1];
+ strcpy(config_path,tmp.c_str());
+ }
+ return config_path;
#endif
// Return the CONFIG_DIR