[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GnuChess continues to run in background
From: |
Jens Hamacher |
Subject: |
GnuChess continues to run in background |
Date: |
Mon, 9 Oct 2006 10:55:27 +0200 |
User-agent: |
KMail/1.9.4 |
Hello,
I was testing the program "glChess" and "knights" on my linux system.
I noticed the following problem:
-gnuchess continues to run in background after quiting knight without closing
game.
-gnuchess continues to run in background after glchess crashes.
What makes this especially obvious is the fact that gnuchess uses all
computation time from the system.
I would be thankful if you made a new version which would include my fix.
I made following fix (I copied the "rinput" function from the
program "sjeng").
gnuchess/src/input.c:
----------------------------
/* The generic input routine */
void rinput (char str[], int n, FILE *stream) {
/* My input function - reads in up to n-1 characters from stream, or until
we encounter a \n or an EOF. Appends a null character at the end of the
string, and stores the string in str[] */
int ch, i = 0;
while ((ch = getc (stream)) != (int) '\n' && ch != EOF) {
if (i < n-1) {
str[i++] = ch;
}
}
if (ch == EOF) {
cmd_quit();
}
str [i] = '\0';
}
void getline_standard(char *p)
{
if (!(flags & XBOARD)) {
fputs(p, stdout);
fflush(stdout);
}
rinput(inputstr, MAXSTR, stdin);
}
------------------------------
Greetings,
Jens Hamacher
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- GnuChess continues to run in background,
Jens Hamacher <=