The error message of "man w xxx" when no man entry for xxx exists
appears on stderr, which is not caught by popen(). As a result the
path to the man file gets set to an empty string, and saveStrCpy
is not so save that it can copy an empty string, but quits XBoard
through an ASSERT in that case.
FREE(manText[1]); manText[1] = NULL; // so any currently held text is worthless
safeStrCpy(tidy, buf, MSG_SIZ); // remember current engine
eng = BufferCommandOutput(tidy, MSG_SIZ); // obtain path to its man file
+ if(*eng)
safeStrCpy(engMan, eng, strlen(eng)); // and remember that too
+ else *engMan = NULLCHAR;
FREE(eng);
}
safeStrCpy(buf, engMan, MSG_SIZ); n = 1; // use engine man