Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37736403
en ru br
ALT Linux repos
S:3.0a-alt2
5.0: 3.0-alt4.a
4.1: 3.0-alt2.a
4.0: 3.0-alt2.a
3.0: 3.0-alt1.a

Other repositories
Upstream:3.0a

Group :: Games/Boards
RPM: foobillard

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: foobillard-datadir.patch
Download


diff -uNr foobillard.old/png_loader.c foobillard/png_loader.c
--- foobillard.old/png_loader.c	Wed Mar 27 13:34:43 2002
+++ foobillard/png_loader.c	Wed Mar 27 13:37:03 2002
@@ -25,6 +25,10 @@
 #define COMPILE_PNG_CODE 0
 #endif
 
+#ifndef DATADIR
+#define DATADIR "./"
+#endif
+
 #if COMPILE_PNG_CODE
 	#include <png.h>
 #else
@@ -47,7 +51,15 @@
     char * buff;
     char ** row_pointers;
 
-    fp = fopen(file_name, "rb");
+    char *real_file_name;
+    
+    real_file_name = malloc(strlen(DATADIR) + strlen(file_name) + 1);
+
+    strncpy(real_file_name, DATADIR, strlen(DATADIR) + 1);
+
+    strncat(real_file_name, file_name, strlen(file_name) + 1);
+    
+    fp = fopen(real_file_name, "rb");
     if (!fp){
         return 0;
     }
@@ -134,6 +146,7 @@
     free(row_pointers);
     free(info_ptr);
     free(png_ptr);
+    free(real_file_name);
     fclose(fp);
 
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin