comparison urogue/getplay.c @ 273:51ddbe7b992d

UltraRogue: begin autoconfiscation. Build options can now be set with configure.
author John "Elwin" Edwards
date Mon, 04 Sep 2017 21:08:09 -0400
parents 778938a5c21d
children 0250220d8cdd
comparison
equal deleted inserted replaced
272:1db299e868b8 273:51ddbe7b992d
14 #include <stdlib.h> 14 #include <stdlib.h>
15 #include <ctype.h> 15 #include <ctype.h>
16 #include <string.h> 16 #include <string.h>
17 #include "rogue.h" 17 #include "rogue.h"
18 18
19 #define CHRDIR "." 19 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif
20 22
21 #define I_STR 0 23 #define I_STR 0
22 #define I_INTEL 1 24 #define I_INTEL 1
23 #define I_WISDOM 2 25 #define I_WISDOM 2
24 #define I_DEXT 3 26 #define I_DEXT 3
36 { 38 {
37 const char *home; 39 const char *home;
38 40
39 home = getenv("HOME"); 41 home = getenv("HOME");
40 42
41 #ifdef CHRDIR 43 #ifdef CHARDIR
42 if (use_savedir) 44 if (use_savedir)
43 { 45 {
44 strncpy(filename, CHRDIR, size); 46 strncpy(filename, CHARDIR, size);
45 filename[size-1] = '\0'; 47 filename[size-1] = '\0';
46 snprintf(filename, size, "%s/%d-%.80s.chr", CHRDIR, md_getuid(), 48 snprintf(filename, size, "%s/%d-%.80s.chr", CHARDIR, md_getuid(),
47 whoami); 49 whoami);
48 return; 50 return;
49 } 51 }
50 #endif 52 #endif
51 if (home) { 53 if (home) {