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

Collapse All | Expand All

(-)a/wl_def.h (-1 / +1 lines)
Lines 915-921 extern unsigned screenofs; Link Here
915
915
916
extern  boolean  startgame;
916
extern  boolean  startgame;
917
extern  char     str[80];
917
extern  char     str[80];
918
extern  char     configname[13];
918
extern  char     configname[128];
919
919
920
//
920
//
921
// Command line parameter variables
921
// Command line parameter variables
(-)a/wl_main.cpp (-1 / +1 lines)
Lines 73-79 boolean startgame; Link Here
73
boolean loadedgame;
73
boolean loadedgame;
74
int     mouseadjustment;
74
int     mouseadjustment;
75
75
76
char    configname[13]="config.";
76
char    configname[128];
77
77
78
//
78
//
79
// Command line parameter variables
79
// Command line parameter variables
(-)a/wl_menu.cpp (+38 lines)
Lines 14-19 Link Here
14
#endif
14
#endif
15
15
16
#include "wl_def.h"
16
#include "wl_def.h"
17
#include <string>
18
#include <errno.h>
17
#pragma hdrstop
19
#pragma hdrstop
18
20
19
extern int lastgamemusicoffset;
21
extern int lastgamemusicoffset;
Lines 3982-3987 ShootSnd (void) Link Here
3982
    SD_PlaySound (SHOOTSND);
3984
    SD_PlaySound (SHOOTSND);
3983
}
3985
}
3984
3986
3987
static void InitConfigname()
3988
{
3989
	if (configname[0])
3990
		/* already initialized */
3991
		return;
3992
	const char *home = getenv("HOME");
3993
	if (!home)
3994
	{
3995
		Quit("You must set $HOME.");
3996
		return;
3997
	}
3998
	std::string s = home;
3999
#define DOT_WOLF_DIR	"/.wolf4sdl"
4000
#ifdef SPEAR
4001
#define CONFIG_BASENAME	"/spear."
4002
#else
4003
#define CONFIG_BASENAME	"/wolf3d."
4004
#endif
4005
	if (s.length() > sizeof(configname) - sizeof(DOT_WOLF_DIR) - sizeof(CONFIG_BASENAME))
4006
	{
4007
		Quit("Your $HOME is too long.");
4008
		return;
4009
	}
4010
	s += DOT_WOLF_DIR;
4011
	errno = 0;
4012
	int r = mkdir(s.c_str(), 0755);
4013
	if (r != 0 && errno != EEXIST)
4014
	{
4015
		int e = errno;
4016
		Quit("Failed to mkdir %s: %s", s.c_str(), strerror(e));
4017
		return;
4018
	}
4019
	s += CONFIG_BASENAME;
4020
	SDL_strlcpy(configname, s.c_str(), sizeof(configname));
4021
}
3985
4022
3986
///////////////////////////////////////////////////////////////////////////
4023
///////////////////////////////////////////////////////////////////////////
3987
//
4024
//
Lines 3992-3997 void Link Here
3992
CheckForEpisodes (void)
4029
CheckForEpisodes (void)
3993
{
4030
{
3994
    struct stat statbuf;
4031
    struct stat statbuf;
4032
	InitConfigname();
3995
4033
3996
//
4034
//
3997
// JAPANESE VERSION
4035
// JAPANESE VERSION

Return to bug 326961