First post, by ripsaw8080
Rank
DOSBox Author
- Rank
- DOSBox Author
Executing DOS commands generates a debug log message such as "EXEC:Parsing command line: blah". When a program shells out to COMMAND.COM to execute a command, a blank line is sometimes displayed in the debugger output view instead of the message; however, the message is always written to the log file if one is active. The blank line is displayed when a trailing carriage return is copied from the command line of COMMAND.COM into a message buffer. The trailing CR isn't always used by DOS programs, but for those cases where it is used, replacing it with a terminator in debug_gui.cpp corrects the problem:
void LOG::operator() (char const* format, ...){
char buf[512];
va_list msg;
va_start(msg,format);
vsprintf(buf,format,msg);
va_end(msg);
+ /* Remove carriage return if present */
+ Bitu len=strlen(buf);
+ if (buf[len-1]=='\r') buf[len-1]='\0';
if (d_type>=LOG_MAX) return;
if ((d_severity!=LOG_ERROR) && (!loggrp[d_type].enabled)) return;
DEBUG_ShowMsg("%10u: %s:%s\n",cycle_count,loggrp[d_type].front,buf);
}