freebsd-ports/games/meritous/files/patch-src-levelblit.c

30 lines
748 B
C

--- src/levelblit.c.orig 2008-01-15 05:54:41.000000000 +0300
+++ src/levelblit.c 2008-11-24 02:16:34.000000000 +0300
@@ -27,7 +27,11 @@
#include <SDL.h>
#include <SDL_image.h>
#include <assert.h>
-
+
+#include <unistd.h>
+#include <err.h>
+#include <sys/stat.h>
+
#include "mapgen.h"
#include "demon.h"
#include "gamemap.h"
@@ -378,6 +382,14 @@
int main(int argc, char **argv)
{
+ {
+ if (chdir(getenv("HOME")) != 0)
+ err(1, "cannot cd to $HOME");
+ if (mkdir(".meritous", 0755) != 0 && errno != EEXIST)
+ err(1, "cannot mkdir $HOME/.meritous");
+ if (chdir(".meritous") != 0)
+ err(1, "cannot cd to $HOME/.meritous");
+ }
int on_title = 1;
int executable_running = 1;
SDL_Surface *title, *title_pr, *asceai;