summaryrefslogtreecommitdiff
path: root/games/exchess/patches/patch-ad
blob: c5b4672d1eac7330197689e08e1e0e13951d3150 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$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 */