gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] sgf output - first edition


From: bump
Subject: Re: [gnugo-devel] sgf output - first edition
Date: Sun, 1 Sep 2002 10:16:44 -0700

>   - if this patch conflicts with ascii_handicap_3_7.1

I added that patch in the CVS today. Your patch does slightly
conflict with that. I merged your patch with the CVS before
posting it. (It will appear on the web page eventually. Unfortunately
the web CVS updates are no longer instantaneous as they used to be.)

Here's another way to get a crash in ascii mode:

load badname.sgf [nonexistent file]
save filename.sgf

This causes a segmentation fault. The patch below fixes it.
I haven't checked if this is still needed after your patch.

- sgftree_readfile does not change root node to NULL

Index: sgf/sgftree.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/sgf/sgftree.c,v
retrieving revision 1.7
diff -u -r1.7 sgftree.c
--- sgf/sgftree.c       4 Mar 2002 06:49:09 -0000       1.7
+++ sgf/sgftree.c       1 Sep 2002 16:44:14 -0000
@@ -34,10 +34,15 @@
 int
 sgftree_readfile(SGFTree *tree, const char *infilename)
 {
+  SGFNode *savetree = tree->root;
+
   tree->root = readsgffile(infilename);
   tree->lastnode = NULL;
-
-  return tree->root != NULL;
+  if (tree->root == NULL) {
+    tree->root = savetree;
+    return NULL;
+  }
+  return 1;
 }
 
 /* ================================================================ */







reply via email to

[Prev in Thread] Current Thread [Next in Thread]