Revert "fix length after '\' getline string termination"

Caused a regression in sed, revert until we investigate further.
This commit is contained in:
sin
2016-03-01 15:23:23 +00:00
parent fa18379a05
commit ea0d16e928
5 changed files with 8 additions and 8 deletions

4
cut.c
View File

@@ -115,8 +115,8 @@ cut(FILE *fp, const char *fname)
Range *r;
while ((len = getline(&buf, &size, fp)) > 0) {
if (buf[len - 1] == '\n')
buf[--len] = '\0';
if (len && buf[len - 1] == '\n')
buf[len - 1] = '\0';
if (mode == 'f' && !utfutf(buf, delim)) {
if (!sflag)
puts(buf);