From e3ea23c51aa7a97c151860f96f8a793bd1ac11ad Mon Sep 17 00:00:00 2001 From: mycroft Date: Tue, 8 Jun 1993 16:49:53 +0000 Subject: [PATCH] fgetline() does not return the newline. --- lib/libc/gen/getcap.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c index 7f70789450fd..6be69f38608f 100644 --- a/lib/libc/gen/getcap.c +++ b/lib/libc/gen/getcap.c @@ -674,21 +674,20 @@ cgetnext(bp, db_array) } else continue; } - } else - line[len - 1] = '\0'; - if (len == 1) { + } + if (len == 0) { slash = 0; continue; } if (isspace(*line) || *line == ':' || *line == '#' || slash) { - if (line[len - 2] == '\\') + if (line[len - 1] == '\\') slash = 1; else slash = 0; continue; } - if (line[len - 2] == '\\') + if (line[len - 1] == '\\') slash = 1; else slash = 0; @@ -723,8 +722,7 @@ cgetnext(bp, db_array) (void)cgetclose(); return (-1); } - } else - line[len - 1] = '\0'; + } } } rp = buf;