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

(-)id_ca.cpp.orig (-1 / +1 lines)
Lines 154-160 Link Here
154
154
155
boolean CA_WriteFile (const char *filename, void *ptr, int32_t length)
155
boolean CA_WriteFile (const char *filename, void *ptr, int32_t length)
156
{
156
{
157
    const int handle = open(filename, O_CREAT | O_WRONLY | O_BINARY);
157
    const int handle = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644);
158
    if (handle == -1)
158
    if (handle == -1)
159
        return false;
159
        return false;
160
160
(-)wl_def.h.orig (-1 / +2 lines)
Lines 915-921 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     configdir[114];
919
extern  char     configname[128];
919
920
920
//
921
//
921
// Command line parameter variables
922
// Command line parameter variables
(-)wl_main.cpp.orig (-1 / +14 lines)
Lines 73-79 Link Here
73
boolean loadedgame;
73
boolean loadedgame;
74
int     mouseadjustment;
74
int     mouseadjustment;
75
75
76
char    configname[13]="config.";
76
char    configdir[114];
77
char    configname[128];
77
78
78
//
79
//
79
// Command line parameter variables
80
// Command line parameter variables
Lines 247-252 Link Here
247
    fs_unlink(configname);
248
    fs_unlink(configname);
248
#endif
249
#endif
249
250
251
    // Ensure configdir exists and create if necessary
252
    struct stat st;
253
    if (stat(configdir, &st) != 0)
254
    {
255
        int result = mkdir(configdir, 0755);
256
        if (result != 0)
257
        {
258
		    Quit("Error: config file could not be saved. The configuration directory,\n'%s', could not be created.", configdir);
259
            return;
260
        }
261
    }
262
250
    const int file = open(configname, O_CREAT | O_WRONLY | O_BINARY, 0644);
263
    const int file = open(configname, O_CREAT | O_WRONLY | O_BINARY, 0644);
251
    if (file != -1)
264
    if (file != -1)
252
    {
265
    {
(-)wl_menu.cpp.orig (+19 lines)
Lines 3993-3998 Link Here
3993
{
3993
{
3994
    struct stat statbuf;
3994
    struct stat statbuf;
3995
3995
3996
    // Set config location to home directory for multi-user support
3997
    // Also support separate configuration files for wolf3d and sod
3998
    if (!getenv("HOME")) {
3999
        Quit("Your $HOME directory is not defined. You must set this before playing.");
4000
		return;
4001
    } else if (strlen(getenv("HOME")) > (sizeof(configdir) - 10)) {
4002
        Quit("Your $HOME directory path is too long. It cannot be used for saving games.");
4003
        return;
4004
    }
4005
    strcpy(configdir, getenv("HOME"));
4006
    strcat(configdir, "/.wolf4sdl");
4007
#ifdef SPEAR
4008
    strcpy(configname, configdir);
4009
    strcat(configname, "/spear.");
4010
#else
4011
    strcpy(configname, configdir);
4012
    strcat(configname, "/wolf3d.");
4013
#endif
4014
3996
//
4015
//
3997
// JAPANESE VERSION
4016
// JAPANESE VERSION
3998
//
4017
//

Return to bug 326961