aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/finger/lprint.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c
index 847f26d195cc..9ab0673e411b 100644
--- a/usr.bin/finger/lprint.c
+++ b/usr.bin/finger/lprint.c
@@ -313,7 +313,8 @@ show_text(directory, file_name, header)
if (cnt <= 1) {
(void)printf("%s: ", header);
for (p = tbuf, cnt = nr; cnt--; ++p)
- vputc(lastc = *p);
+ if (*p != '\r')
+ vputc(lastc = *p);
if (lastc != '\n')
(void)putchar('\n');
(void)close(fd);
@@ -326,7 +327,8 @@ show_text(directory, file_name, header)
return(0);
(void)printf("%s:\n", header);
while ((ch = getc(fp)) != EOF)
- vputc(lastc = ch);
+ if (ch != '\r')
+ vputc(lastc = ch);
if (lastc != '\n')
(void)putchar('\n');
(void)fclose(fp);