freebsd-ports/games/kartofel/files/patch-play.cc
Dmitry Marakasov d43762e4ed Kartofel is a game of skill and logic. The objective is to connect
the numbered dots in order, without crossing over yourself.

WWW: http://kartofel.jfedor.org/
2009-01-19 18:42:25 +00:00

28 lines
664 B
C++

--- play.cc.orig 2009-01-18 01:21:03.000000000 +0300
+++ play.cc 2009-01-19 08:14:26.000000000 +0300
@@ -30,6 +30,9 @@
#include "SDL_mixer.h"
#include "SDL_thread.h"
#include "SDL_ttf.h"
+#include <unistd.h>
+#include <err.h>
+#include <sys/stat.h>
#include "config.h"
#include "game.h"
@@ -2028,6 +2031,15 @@
int main(int argc, char** argv)
{
+ {
+ if (chdir(getenv("HOME")) != 0)
+ err(1, "cannot cd to $HOME");
+ if (mkdir(".kartofel", 0755) != 0 && errno != EEXIST)
+ err(1, "cannot mkdir $HOME/.kartofel");
+ if (chdir(".kartofel") != 0)
+ err(1, "cannot cd to $HOME/.kartofel");
+ }
+
kartofel::Run();
return 0;
}