403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.103
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/games/shockolate/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/games/shockolate/files/patch-src_GameSrc_setup.c
--- src/GameSrc/setup.c.orig	2020-04-23 04:29:54 UTC
+++ src/GameSrc/setup.c
@@ -25,6 +25,7 @@ along with this program.  If not, see <http://www.gnu.
 
 #define __SETUP_SRC
 
+#include <stdlib.h>
 #include <string.h>
 
 // TODO: extract this into a compatibility header
@@ -36,6 +37,10 @@ along with this program.  If not, see <http://www.gnu.
 	#include <unistd.h>
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #include "archiveformat.h"
 #include "ShockDialogs.h"
 #include "setup.h"
@@ -1305,8 +1310,21 @@ uchar intro_key_handler(uiEvent *ev, LGRegion *r, intp
   return (main_kb_callback(ev, r, user_data));
 }
 
+static int file_exists_in_homedir_p (const char *filename)
+{
+    char *home = getenv ("HOME");
+    char path[PATH_MAX];
+    int res = 0;
 
+    if (home != NULL) {
+        snprintf (path, PATH_MAX, "%s/.sshock/%s",
+                  home, filename);
+        res = access (path, F_OK) != -1;
+    }
 
+    return res;
+}
+
 errtype load_savegame_names(void)
 {
   int i;
@@ -1320,7 +1338,7 @@ errtype load_savegame_names(void)
   {
     Poke_SaveName(i);
 
-    if (access(save_game_name, F_OK) != -1)
+    if (file_exists_in_homedir_p (save_game_name))
     {
       file = ResOpenFile(save_game_name);
       if (ResInUse(OLD_SAVE_GAME_ID_BASE))

Youez - 2016 - github.com/yon3zu
LinuXploit