pkgsrc/games/exchess/patches/patch-ad

39 lines
1 KiB
Text

$NetBSD: patch-ad,v 1.1.1.1 2000/10/25 08:40:00 jlam Exp $
--- main.cpp.orig Sat Apr 1 07:46:20 2000
+++ main.cpp
@@ -17,6 +17,7 @@
#if UNIX
#include <sys/types.h>
#include <sys/time.h>
+ #include <unistd.h>
#else
#include <windows.h>
#include <time.h>
@@ -56,7 +57,7 @@
extern int ponder, last_ponder, learn_count, learned;
extern unsigned long TAB_SIZE, PAWN_SIZE;
-// executable directory
+// exchess opening book and search parameters directory
char exec_path[100];
// performance function
@@ -93,16 +94,7 @@
learn_count = 0; learned = 0; learn_bk = 1; shout_book = 0;
- strcpy(exec_path, argv[0]);
- // parsing exec path
- int last_slash = 0;
- for(int j = 0; j < 100; j++) {
- if(exec_path[j] == '\0') break;
- if(exec_path[j] == '\\') last_slash = j;
- if(exec_path[j] == '/') last_slash = j;
- }
-
- exec_path[last_slash+1] = '\0';
+ strcpy(exec_path, EXCHESS_DIR);
/* initializing hash tables, check tables, scoring parameters,
and the random number seed and tablebases */