X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=f6e75c49f0e69aa380491ecdccc2ddb9739b3116;hb=2b59fb6b9575ad038bae89a48063084c8b3243a9;hp=f560b2f9d0bd85ef92083adef8c9f2bc691637dd;hpb=007b64fc1619db18bae80e661e0e98f3bd2da012;p=xboard.git diff --git a/backend.c b/backend.c index f560b2f..f6e75c4 100644 --- a/backend.c +++ b/backend.c @@ -57,6 +57,9 @@ #define DoSleep( n ) if( (n) != 0 ) Sleep( (n) ); +int flock(int f, int code); +#define LOCK_EX 2 + #else #define DoSleep( n ) if( (n) >= 0) sleep(n) @@ -325,7 +328,7 @@ safeStrCpy( char *dst, const char *src, size_t count ) { dst[ count-1 ] = '\0'; // make sure incomplete copy still null-terminated if(appData.debugMode) - fprintf(debugFP, "safeStrCpy: copying %s into %s didn't work, not enough space %d\n",src,dst,count); + fprintf(debugFP, "safeStrCpy: copying %s into %s didn't work, not enough space %d\n",src,dst, (int)count); } return dst; @@ -841,6 +844,7 @@ ReplaceEngine(ChessProgramState *cps, int n) appData.noChessProgram = False; appData.clockMode = True; InitEngine(cps, n); + if(n) return; // only startup first engine immediately; second can wait savCps = cps; // parameter to LoadEngine passed as globals, to allow scheduled calling :-( LoadEngine(); } @@ -2983,9 +2987,9 @@ read_from_ics(isr, closure, data, count, error) } } // [HGM] chat: end of patch + backup = i; if (appData.zippyTalk || appData.zippyPlay) { /* [DM] Backup address for color zippy lines */ - backup = i; #if ZIPPY if (loggedOn == TRUE) if (ZippyControl(buf, &backup) || ZippyConverse(buf, &backup) || @@ -3150,6 +3154,8 @@ read_from_ics(isr, closure, data, count, error) continue; } + if(i < backup) { i = backup; continue; } // [HGM] for if ZippyControl matches, but the colorie code doesn't + if (looking_at(buf, &i, "\\ ")) { if (prevColor != ColorNormal) { if (oldi > next_out) {