Update of /cvsroot/super-tux/supertux/lib/app
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12128/lib/app
Modified Files:
setup.cpp
Log Message:
make supertux accepts normal paths on the commandline
Index: setup.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- setup.cpp 24 Nov 2004 23:10:01 -0000 1.20
+++ setup.cpp 25 Nov 2004 19:48:24 -0000 1.21
@@ -280,10 +280,9 @@
st_dir = home + "/." + package_symbol_name;
/* Remove .supertux config-file from old SuperTux versions */
- if(FileSystem::faccessible(st_dir))
- {
- remove(st_dir.c_str());
- }
+ if(FileSystem::faccessible(st_dir)) {
+ remove(st_dir.c_str());
+ }
st_save_dir = st_dir + "/save";
@@ -296,7 +295,7 @@
// try current directory as datadir
if(datadir.empty()) {
if(FileSystem::faccessible("./data/intro.txt"))
- datadir = "./data";
+ datadir = "./data/";
}
// User has not that a datadir, so we try some magic
@@ -314,23 +313,25 @@
{
std::string exedir = std::string(dirname(exe_file)) + "/";
- datadir = exedir + "../data"; // SuperTux run from source dir
+ datadir = exedir + "../data/"; // SuperTux run from source dir
if (access(datadir.c_str(), F_OK) != 0)
{
- datadir = exedir + "../../data"; //SuperTux run from source dir (with libtool script)
+ datadir = exedir + "../../data/"; //SuperTux run from source dir (with libtool script)
if (access(datadir.c_str(), F_OK) != 0)
{
- datadir = exedir + "../share/" + package_symbol_name; // SuperTux run from PATH
+ datadir = exedir + "../share/" + package_symbol_name + "/"; // SuperTux run from PATH
if (access(datadir.c_str(), F_OK) != 0)
{ // If all fails, fall back to compiled path
- datadir = DATA_PREFIX;
+ datadir = DATA_PREFIX;
+ datadir += "/";
}
}
}
}
#else
- datadir = DATA_PREFIX;
+ datadir = DATA_PREFIX;
+ datadir += "/";
#endif
}
printf("Datadir: %s\n", datadir.c_str());
|