From e4f5a605d7c328e342146cec55cf233a976fadd4 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 12 Feb 2012 02:53:01 +0000 Subject: Fix some typos and compilation errors introduced in the last checkin git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4384 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/drivers/ramlog.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'nuttx/drivers') diff --git a/nuttx/drivers/ramlog.c b/nuttx/drivers/ramlog.c index 53e57b1a0..6c24b0f95 100644 --- a/nuttx/drivers/ramlog.c +++ b/nuttx/drivers/ramlog.c @@ -419,6 +419,14 @@ static ssize_t ramlog_write(FAR struct file *filep, FAR const char *buffer, size ch = buffer[nwritten]; + /* Ignore carriage returns */ + +#ifdef CONFIG_RAMLOG_CRLF + if (ch == '\r') + { + continue; + } + /* Pre-pend a carriage before a linefeed */ if (ch == '\n') @@ -434,6 +442,7 @@ static ssize_t ramlog_write(FAR struct file *filep, FAR const char *buffer, size break; } } +#endif /* Then output the character */ @@ -732,6 +741,14 @@ int ramlog_putc(int ch) FAR struct ramlog_dev_s *priv = &g_sysdev; int ret; + /* Ignore carriage returns */ + +#ifdef CONFIG_RAMLOG_CRLF + if (ch == '\r') + { + return ch; + } + /* Pre-pend a newline with a carriage return */ if (ch == '\n') @@ -747,6 +764,7 @@ int ramlog_putc(int ch) return ch; } } +#endif (void)ramlog_addchar(priv, ch); return ch; -- cgit v1.2.3