Commit 47367287 by Francois Gygi

echo commands in <cmd> </cmd> elements


git-svn-id: http://qboxcode.org/svn/qb/trunk@817 cba15fb0-1239-40c8-b417-11db7ca47a34
parent c438f033
......@@ -104,15 +104,16 @@ int UserInterface::readCmd(char *s, int max, istream &fp, bool echo)
return 0; /* return 0 for end of file */
// output command line if reading from a script
if ( echo ) cout << s;
if ( echo && i > 0 ) cout << "<cmd>" << s << "</cmd>";
if ( ch == '#' )
{
if ( echo ) cout << '#';
if ( echo ) cout << "<cmd>#";
while ( (ch = fp.get()) != EOF && !( ch == '\n' ) )
{
if ( echo ) cout << (char) ch;
}
if ( echo && ch=='\n' ) cout << "</cmd>";
if ( !(ch == '\n') )
return 0; /* return 0 for end of file */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment