* PROJECT: ReactOS Automatic Testing Utility
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
* PURPOSE: Various helper functions
- * COPYRIGHT: Copyright 2008-2009 Colin Finck <colin@reactos.org>
+ * COPYRIGHT: Copyright 2008-2015 Colin Finck <colin@reactos.org>
*/
#include "precomp.h"
}
DbgString[size] = 0;
- DbgPrint(DbgString);
+ DbgPrint("%s", DbgString);
}
last_newline = curr_pos;
}
}
- /* Output the string */
- cout << NewString;
-
size = curr_pos - start;
/* Only print if forced to or if the rest is a whole line */
if(forcePrint == true || NewString[curr_pos - 1] == '\n')
{
+ /* Output the whole string */
+ if(Configuration.DoPrint())
+ cout << NewString << flush;
+
memcpy(DbgString, NewString.c_str() + start, size);
DbgString[size] = 0;
- DbgPrint(DbgString);
+ DbgPrint("%s", DbgString);
NewString.clear();
return NewString;
}
+ /* Output full lines only */
+ if(Configuration.DoPrint())
+ cout << NewString.substr(0, start) << flush;
+
/* Return the remaining chunk */
return NewString.substr(start, size);
}