[gcompris] Fixed selection of internal gnuchess by default



commit 95ece61c53a742d30c5a0b1eadc7a62c1d1178fd
Author: Cosimo Cecchi <cosimo cecchi gmail com>
Date:   Tue Mar 4 23:08:59 2014 +0100

    Fixed selection of internal gnuchess by default

 configure.ac                        |    2 +-
 src/chess_computer-activity/chess.c |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 14da41d..6545343 100644
--- a/configure.ac
+++ b/configure.ac
@@ -357,7 +357,7 @@ else
   AC_DEFINE_UNQUOTED(SYSTEM_CONFIG_DIR, "/etc", [System GCompris config directory])
 
   dnl Test for gnuchess
-  if test x$GNUCHESS = xno; then
+  if test x$GNUCHESS = x; then
     GNUCHESS="gcompris-gnuchess"
   fi
   AC_DEFINE_UNQUOTED(GNUCHESS, "$GNUCHESS", Defines where GNU Chess resides on the system)
diff --git a/src/chess_computer-activity/chess.c b/src/chess_computer-activity/chess.c
index 6f4d713..e3569dd 100644
--- a/src/chess_computer-activity/chess.c
+++ b/src/chess_computer-activity/chess.c
@@ -248,8 +248,12 @@ static void start_board (GcomprisBoard *agcomprisBoard)
        {
          /* Check in our exec prefix */
          extern gchar *exec_prefix;
-         gnuchess_bin = g_build_filename(exec_prefix, *gnuchess_pathptr,
-                                         NULL);
+
+         if (exec_prefix != NULL)
+           gnuchess_bin = g_build_filename(exec_prefix, *gnuchess_pathptr,
+                                           NULL);
+         else
+           gnuchess_bin = g_find_program_in_path(*gnuchess_pathptr);
        }
 
       if (g_file_test (gnuchess_bin, G_FILE_TEST_IS_EXECUTABLE))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]