summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/finger')
-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 847f26d..9ab0673 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);
OpenPOWER on IntegriCloud