gnugo-devel
[Top][All Lists]
Advanced

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

Re[2]: [gnugo-devel] sgf loading (v 3.3.5)


From: Paul Pogonyshev
Subject: Re[2]: [gnugo-devel] sgf loading (v 3.3.5)
Date: Mon, 26 Aug 2002 10:47:12 +0300

[on 1 aug Gunnar answered me]
>> Load an sgf file and then undo twice. GNU Go hangs due to an access
>> violation. Field curnode->parent is 0. I don't know what was supposed
>> to be done in such cases, but i think that either the complete game
>> tree should be read, allowing undoing, or undoing should be prohibited
>> after loading.

> If the game is loaded when starting with the -l option, undo works
> without trouble. From a quick inspection it looks to me like the ascii
> load command is buggy, failing to update the curnode pointer. Feel
> free to try to find out how to fix it. Undo should work also after a
> load and definitely not crash.

ok, i finally decided to find what caused the mistake. looks like it's
solved now. sorry, i don't know how to create a patch (i use windows),
but here is a code snippet (play_ascii.c):

        case CMD_LOAD:
          strtok(command, " ");
          tmpstring = strtok(NULL, " ");
          if (tmpstring) {
            /* discard newline */
            tmpstring[strlen(tmpstring)-1] = 0;
            if (!sgftree_readfile(&sgftree, tmpstring))
              {
                fprintf(stderr, "Cannot open or parse '%s'\n", tmpstring);
                break;
              }
            sgf_initialized = 0;
            gameinfo_play_sgftree(gameinfo, sgftree.root, NULL);
            sgfOverwritePropertyInt(sgftree.root, "HA", gameinfo->handicap);
***         curnode = sgftreeNodeCheck(&sgftree, 0);
          }

all you need to do is to insert the marked line (in 3.3.5 it's line
921).

i tested the recompiled version and it works (i didn't mess it up ;).

regards,
  Paul Pogonyshev

p.s.   couldn't you please name some environment for windows which can
       work with that patches? maybe i would start doing something
       useful, not fixing play_ascii ;)





reply via email to

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