From 389e190b1edefb62005e5ff30e5c79080e985168 Mon Sep 17 00:00:00 2001 From: Tim Mann Date: Sat, 3 Apr 2004 20:44:00 +0000 Subject: [PATCH] 1. Fix compilation error on line 308: missing type name. 2. Fix popen bug -- thanks to John Iverson. 3. Remove bogus ^M characters inserted by the Windows editor Daniel was using. --- backend.c | 50 +++++++++++++++++++++++++------------------------- 1 files changed, 25 insertions(+), 25 deletions(-) diff --git a/backend.c b/backend.c index 8ea75c8..a23803c 100644 --- a/backend.c +++ b/backend.c @@ -212,10 +212,10 @@ void ParseFeatures P((char* args, ChessProgramState *cps)); void InitBackEnd3 P((void)); void FeatureDone P((ChessProgramState* cps, int val)); void InitChessProgram P((ChessProgramState *cps)); - -#ifdef WIN32 - extern void ConsoleCreate(); -#endif + +#ifdef WIN32 + extern void ConsoleCreate(); +#endif extern int tinyLayout, smallLayout; static ChessProgramStats programStats; @@ -305,7 +305,7 @@ Boolean alarmSounded; /* end premove variables */ char *ics_prefix = "$"; -ics_type = ICS_GENERIC; +int ics_type = ICS_GENERIC; int currentMove = 0, forwardMostMove = 0, backwardMostMove = 0; int pauseExamForwardMostMove = 0; @@ -692,12 +692,12 @@ InitBackEnd3 P((void)) char buf[MSG_SIZ]; int err; - InitChessProgram(&first); - - #ifdef WIN32 - /* Make a console window if needed */ - if (appData.icsActive) ConsoleCreate(); - #endif + InitChessProgram(&first); + + #ifdef WIN32 + /* Make a console window if needed */ + if (appData.icsActive) ConsoleCreate(); + #endif if (appData.icsActive) { err = establish(); @@ -1466,11 +1466,11 @@ read_from_ics(isr, closure, data, count, error) int i, oldi; int buf_len; int next_out; - int tkind; -#ifdef WIN32 - /* For zippy color lines of winboard - * cleanup for gcc compiler */ - int backup; + int tkind; +#ifdef WIN32 + /* For zippy color lines of winboard + * cleanup for gcc compiler */ + int backup; #endif char *p; @@ -1728,20 +1728,20 @@ read_from_ics(isr, closure, data, count, error) oldi = i; if (appData.zippyTalk || appData.zippyPlay) { -#if ZIPPY - #ifdef WIN32 - /* Backup address for color zippy lines */ - backup = i; - if (loggedOn == TRUE) - if (ZippyControl(buf, &backup) || ZippyConverse(buf, &backup) || - (appData.zippyPlay && ZippyMatch(buf, &backup))); +#if ZIPPY + #ifdef WIN32 + /* Backup address for color zippy lines */ + backup = i; + if (loggedOn == TRUE) + if (ZippyControl(buf, &backup) || ZippyConverse(buf, &backup) || + (appData.zippyPlay && ZippyMatch(buf, &backup))); #else if (ZippyControl(buf, &i) || ZippyConverse(buf, &i) || (appData.zippyPlay && ZippyMatch(buf, &i))) { loggedOn = TRUE; continue; - } + } #endif #endif } @@ -6975,7 +6975,7 @@ MailMoveEvent() || (nCmailMovesRegistered + nCmailResults == nCmailGames)) { sprintf(string, partCommandString, appData.debugMode ? " -v" : "", appData.cmailGameName); - commandOutput = popen(string, "rb"); + commandOutput = popen(string, "r"); if (commandOutput == NULL) { DisplayError(_("Failed to invoke cmail"), 0); -- 1.7.0.4