diff --git a/getcoeff.c b/getcoeff.c index 02abbbe..e02a3ca 100644 --- a/getcoeff.c +++ b/getcoeff.c @@ -936,8 +936,9 @@ init_coeffs( void ) { getcwd(sPatternFile, sizeof(sPatternFile)); strcat(sPatternFile, "/" PATTERN_FILE); #endif + char* env_coeffs = getenv("COEFFS_PATH"); - coeff_stream = gzopen( sPatternFile, "rb" ); + coeff_stream = gzopen(env_coeffs ? env_coeffs : sPatternFile, "rb" ); if ( coeff_stream == NULL ) fatal_error( "%s '%s'\n", FILE_ERROR, sPatternFile ); diff --git a/zebra.c b/zebra.c index 6ade0e8..a8e11fd 100644 --- a/zebra.c +++ b/zebra.c @@ -609,8 +609,13 @@ main( int argc, char *argv[] ) { global_setup( use_random, hash_bits ); init_thor_database(); - if ( use_book ) - init_learn( "book.bin", TRUE ); + if ( use_book ) { + char *book_filename = getenv("BOOK_PATH"); + if (book_filename == NULL) { + book_filename = "book.bin"; + } + init_learn(book_filename, TRUE ); + } if ( use_random && !SCRIPT_ONLY ) { time( &timer ); my_srandom( timer );