Implemented line-oriented buffering for std output

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3606 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-05-14 15:21:04 +00:00
parent 764a1177eb
commit 6e4aa998e8
15 changed files with 214 additions and 24 deletions
+13
View File
@@ -1127,7 +1127,20 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, const char *src, va_list ap)
if (*src != '%')
{
/* Output the character */
obj->put(obj, *src);
/* Flush the buffer if a newline is encountered */
#ifdef CONFIG_STDIO_LINEBUFFER
if (*src == '\n')
{
(void)obj->flush(obj);
}
#endif
/* Process the next character in the format */
continue;
}