[gcompris-devel] [PATCH] Support GNUCHESS environment variable
Bruno Coudoin
bruno.coudoin at free.fr
Sun Jul 11 22:33:56 UTC 2010
Thanks a lot Aleksey. You 3 patches have been commited (sqlite, gnuchess
and gnucap).
Bruno.
Le mercredi 26 mai 2010 à 05:40 +0000, Aleksey Lim a écrit :
> Will be useful in 0install environment when GnuChess is installed from 0install feed.
> ---
> src/chess_computer-activity/chess.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/chess_computer-activity/chess.c b/src/chess_computer-activity/chess.c
> index 27e02c4..31a33de 100644
> --- a/src/chess_computer-activity/chess.c
> +++ b/src/chess_computer-activity/chess.c
> @@ -229,12 +229,15 @@ static void start_board (GcomprisBoard *agcomprisBoard)
> {
>
> gchar **gnuchess_pathptr = gnuchess_path;
> - gchar *gnuchess_bin = NULL;
> + gchar *gnuchess_bin = g_strdup(getenv("GNUCHESS"));
>
>
> do
> {
> - if(*gnuchess_pathptr[0] == '/')
> + if(gnuchess_bin != NULL)
> + {
> + }
> + else if(*gnuchess_pathptr[0] == '/')
> {
> gnuchess_bin = strdup(*gnuchess_pathptr);
> }
> @@ -251,6 +254,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
>
> gnuchess_pathptr++;
> g_free(gnuchess_bin);
> + gnuchess_bin = NULL;
> } while(*gnuchess_pathptr != NULL);
>
> if(*gnuchess_pathptr == NULL)
More information about the Gcompris-devel
mailing list