summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/misc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c
index 3bee0772a6..5b20b35c17 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -198,6 +198,13 @@ int fast_readline(int fd, char *buf, int buf_size, void *parameters,
next = ++p;
}
+ if ( (p = strchr(buf, '\r')) != NULL)
+ {
+ *p = '\0';
+ if (!next)
+ next = ++p;
+ }
+
rc = callback(count, buf, parameters);
if (rc < 0)
return rc;