summaryrefslogtreecommitdiff
path: root/usr.bin/rev/rev.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/rev/rev.c')
-rw-r--r--usr.bin/rev/rev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/rev/rev.c b/usr.bin/rev/rev.c
index bdbf3f4bcab2..66be64aacb1a 100644
--- a/usr.bin/rev/rev.c
+++ b/usr.bin/rev/rev.c
@@ -38,7 +38,8 @@ char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)rev.c 5.2 (Berkeley) 3/21/92";
+/*static char sccsid[] = "from: @(#)rev.c 5.2 (Berkeley) 3/21/92";*/
+static char rcsid[] = "$Id: rev.c,v 1.2 1994/04/17 09:36:50 alm Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -83,7 +84,9 @@ main(argc, argv)
}
filename = *argv++;
}
- while (p = fgetline(fp, &len)) {
+ while (p = fgetln(fp, &len)) {
+ if (p[len-1] == '\n')
+ --len;
t = p + len - 1;
for (t = p + len - 1; t >= p; --t)
putchar(*t);