diff -ru crafty-20.14-orig/chess.h crafty-20.14/chess.h --- crafty-20.14-orig/chess.h 2007-03-23 21:46:15.000000000 -0700 +++ crafty-20.14/chess.h 2007-03-23 21:53:36.000000000 -0700 @@ -136,6 +136,9 @@ #if !defined(PERSDIR) # define PERSDIR "." #endif +#if !defined(LEARNDIR) +# define LEARNDIR "." +#endif #if !defined(LOGDIR) # define LOGDIR "." #endif Only in crafty-20.14: chess.h.orig diff -ru crafty-20.14-orig/data.c crafty-20.14/data.c --- crafty-20.14-orig/data.c 2007-03-23 21:46:15.000000000 -0700 +++ crafty-20.14/data.c 2007-03-23 21:53:36.000000000 -0700 @@ -209,6 +209,7 @@ int new_game = 0; char channel_title[32] = { "" }; char book_path[128] = { BOOKDIR }; +char learn_path[128] = { LEARNDIR }; char personality_path[128] = { PERSDIR }; char log_path[128] = { LOGDIR }; char tb_path[128] = { TBDIR }; Only in crafty-20.14: data.c.orig diff -ru crafty-20.14-orig/data.h crafty-20.14/data.h --- crafty-20.14-orig/data.h 2007-03-23 21:46:15.000000000 -0700 +++ crafty-20.14/data.h 2007-03-23 21:53:36.000000000 -0700 @@ -90,6 +90,7 @@ extern int channel; extern char channel_title[32]; extern char book_path[128]; +extern char learn_path[128]; extern char personality_path[128]; extern char log_path[128]; extern char tb_path[128]; Only in crafty-20.14: data.h.orig diff -ru crafty-20.14-orig/init.c crafty-20.14/init.c --- crafty-20.14-orig/init.c 2007-03-23 21:46:15.000000000 -0700 +++ crafty-20.14/init.c 2007-03-23 21:53:36.000000000 -0700 @@ -173,15 +173,15 @@ books_file = 0; } } - sprintf(log_filename, "%s/book.lrn", book_path); + sprintf(log_filename, "%s/book.lrn", learn_path); book_lrn_file = fopen(log_filename, "a"); if (!book_lrn_file) { - Print(128, "unable to open book learning file [%s/book.lrn].\n", book_path); + Print(128, "unable to open book learning file [%s/book.lrn].\n", learn_path); Print(128, "learning disabled.\n"); learning &= ~(book_learning + result_learning); } if (learning & position_learning) { - sprintf(log_filename, "%s/position.bin", book_path); + sprintf(log_filename, "%s/position.bin", learn_path); position_file = fopen(log_filename, "rb+"); if (position_file) { fseek(position_file, 0, SEEK_END); @@ -199,12 +199,12 @@ fwrite(&i, sizeof(int), 1, position_file); } else { Print(128, "unable to open position learning file [%s/position.bin].\n", - book_path); + learn_path); Print(128, "learning disabled.\n"); learning &= ~position_learning; } } - sprintf(log_filename, "%s/position.lrn", book_path); + sprintf(log_filename, "%s/position.lrn", learn_path); position_lrn_file = fopen(log_filename, "r"); if (!position_lrn_file) { position_lrn_file = fopen(log_filename, "a"); @@ -212,7 +212,7 @@ fprintf(position_lrn_file, "position\n"); else { Print(128, "unable to open position learning file [%s/position.bin].\n", - book_path); + learn_path); Print(128, "learning disabled.\n"); learning &= ~position_learning; } diff -ru crafty-20.14-orig/learn.c crafty-20.14/learn.c --- crafty-20.14-orig/learn.c 2007-03-23 21:46:15.000000000 -0700 +++ crafty-20.14/learn.c 2007-03-23 21:53:36.000000000 -0700 @@ -552,7 +552,7 @@ int index[32768], i, j, cluster; fclose(book_lrn_file); - sprintf(text, "%s/book.lrn", book_path); + sprintf(text, "%s/book.lrn", learn_path); book_lrn_file = fopen(text, "w"); fseek(book_file, 0, SEEK_SET); for (i = 0; i < 32768; i++) { @@ -905,15 +905,15 @@ } if (nargs > 1 && !strcmp(args[1], "clear")) { fclose(position_file); - sprintf(text, "%s/position.lrn", book_path); + sprintf(text, "%s/position.lrn", learn_path); position_lrn_file = fopen(text, "w"); if (!position_lrn_file) { printf("unable to open position learning file [%s/position.lrn].\n", - book_path); + learn_path); return; } fprintf(position_lrn_file, "position\n"); - sprintf(text, "%s/position.bin", book_path); + sprintf(text, "%s/position.bin", learn_path); position_file = fopen(text, "wb+"); if (position_file) { i = 0; @@ -923,7 +923,7 @@ fwrite(&i, sizeof(int), 1, position_file); } else { printf("unable to open position learning file [%s/position.bin].\n", - book_path); + learn_path); return; } } Only in crafty-20.14: learn.c.orig diff -ru crafty-20.14-orig/main.c crafty-20.14/main.c --- crafty-20.14-orig/main.c 2007-03-23 21:46:15.000000000 -0700 +++ crafty-20.14/main.c 2007-03-23 21:53:36.000000000 -0700 @@ -3414,6 +3414,9 @@ shared = SharedMalloc(sizeof(SHARED), 0); if (directory_spec) strncpy(book_path, directory_spec, sizeof book_path); + directory_spec = getenv("CRAFTY_LEARN_PATH"); + if (directory_spec) + strncpy(learn_path, directory_spec, sizeof learn_path); directory_spec = getenv("CRAFTY_LOG_PATH"); if (directory_spec) strncpy(log_path, directory_spec, sizeof log_path); Only in crafty-20.14: main.c.orig diff -ru crafty-20.14-orig/option.c crafty-20.14/option.c --- crafty-20.14-orig/option.c 2007-03-23 21:46:15.000000000 -0700 +++ crafty-20.14/option.c 2007-03-23 21:53:36.000000000 -0700 @@ -2326,19 +2326,21 @@ ************************************************************ */ else if (OptionMatch("logpath", *args) || OptionMatch("perspath", *args) - || OptionMatch("bookpath", *args) || OptionMatch("tbpath", *args)) { + || OptionMatch("bookpath", *args) || OptionMatch("learnpath", *args) || OptionMatch("tbpath", *args)) { if (OptionMatch("logpath", *args) || OptionMatch("bookpath", *args)) { if (log_file) Print(4095, "ERROR -- this must be used on command line only\n"); } nargs = ReadParse(buffer, args, " ="); if (nargs < 2) { - printf("usage: bookpath|perspath|logpath|tbpath \n"); + printf("usage: bookpath|learnpath|perspath|logpath|tbpath \n"); return (1); } if (!strchr(args[1], '(')) { if (strstr(args[0], "bookpath")) strcpy(book_path, args[1]); + else if (strstr(args[0], "learnpath")) + strcpy(learn_path, args[1]); else if (strstr(args[0], "perspath")) strcpy(personality_path, args[1]); else if (strstr(args[0], "logpath"))