Index: engine/clock.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/clock.c,v
retrieving revision 1.24
diff -u -p -r1.24 clock.c
--- engine/clock.c	19 Oct 2005 09:55:04 -0000	1.24
+++ engine/clock.c	21 Oct 2005 13:33:45 -0000
@@ -124,6 +124,8 @@ clock_print(int color)
 /*
  * Initialize the time settings for this game.
  * -1 means "do not modify this value".
+ *
+ *  byo_time > 0 and byo_stones == 0 means no time settings.
  */
 void
 clock_settings(int time, int byo_time, int byo_stones)
@@ -141,15 +143,15 @@ clock_settings(int time, int byo_time, i
  * 0 otherwise.
  */
 int
-get_clock_settings(int *t, int *byo_t, int *byo_s)
+have_time_settings(void)
 {
-  if (t)
-    *t = main_time;
-  if (byo_t)
-    *byo_t = byoyomi_time;
-  if (byo_s)
-    *byo_s = byoyomi_stones;
-  return (main_time >= 0 || byoyomi_time >= 0);
+  /* According to the semantics of the GTP command 'time_settings', the
+   * following signifies no time limits.
+   */
+  if (byoyomi_time > 0 && byoyomi_stones == 0)
+    return 0;
+  else
+    return (main_time >= 0 || byoyomi_time >= 0);
 }
 
 
@@ -182,6 +184,11 @@ update_time_left(int color, int time_lef
     = ((color == BLACK) ? &black_time_data : &white_time_data);
   int time_used = td->official.time_left - time_left;
 
+  if (time_left > 0)
+    td->time_out = 0;
+  else 
+    td->time_out = 1;
+
   /* Did our estimate for time usage go wrong? */
   if (time_used > 0
       && gg_abs(time_used - td->estimated.time_for_last_move) >= 1.0)
@@ -193,6 +200,8 @@ update_time_left(int color, int time_lef
     td->estimated.time_left = time_left;
   if (stones > 0)
     td->estimated.in_byoyomi = 1;
+  else
+    td->estimated.in_byoyomi = 0;
 
   td->official.stones = stones;
   td->official.movenum = movenum;
@@ -213,6 +222,9 @@ clock_push_button(int color)
     = (color == BLACK) ? &black_time_data : &white_time_data;
   double now = gg_gettimeofday();
 
+  if (!have_time_settings())
+    return;
+
   if (last_movenum >= 0
       && movenum == last_movenum + 1
       && movenum > td->estimated.movenum) {
@@ -274,7 +286,7 @@ analyze_time_data(int color, double *tim
 	               : &white_time_data.estimated;
 
   /* Do we have any time limits. */
-  if (!get_clock_settings(NULL, NULL, NULL))
+  if (!have_time_settings())
     return 0;
 
   /* If we don't have consistent time information yet, just return. */
Index: engine/clock.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/clock.h,v
retrieving revision 1.12
diff -u -p -r1.12 clock.h
--- engine/clock.h	19 Oct 2005 09:55:04 -0000	1.12
+++ engine/clock.h	21 Oct 2005 13:33:45 -0000
@@ -26,14 +26,14 @@
 #include "gnugo.h"
 
 /* initialization and activation */
-void clock_settings(int time, int byo_time, int byo_stones);
+void clock_settings(int maintyime, int byotime, int byostones);
 void init_timers(void);
  
 /* main access */
 void clock_push_button(int color);
 void update_time_left(int color, int time_left, int stones);
 void clock_print(int color);
-int get_clock_settings(int *t, int *byo_t, int *byo_s);
+int have_time_settings(void);
 
 void adjust_level_offset(int color);
 
Index: interface/play_ascii.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_ascii.c,v
retrieving revision 1.63
diff -u -p -r1.63 play_ascii.c
--- interface/play_ascii.c	21 Oct 2005 10:38:42 -0000	1.63
+++ interface/play_ascii.c	21 Oct 2005 13:33:45 -0000
@@ -627,7 +627,7 @@ do_play_ascii(Gameinfo *gameinfo)
   char *tmpstring;
   int state = 1;
 
-  if (get_clock_settings(NULL, NULL, NULL))
+  if (have_time_settings())
     clock_on = 1;
 
   while (state == 1) {

