[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cut loadable outputs extra newlines
From: |
Geir Hauge |
Subject: |
cut loadable outputs extra newlines |
Date: |
Wed, 10 Aug 2022 22:50:22 +0200 |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin20.6.0
Compiler: gcc
Compilation CFLAGS: -g -O2
uname output: Darwin macspear 20.6.0 Darwin Kernel Version 20.6.0: Tue Apr 19 2$
Machine Type: x86_64-apple-darwin20.6.0
Bash Version: 5.2
Patch Level: 0
Release Status: rc3
Description:
examples/loadables/cut.c uses zgetline, which includes the newline
delimiter in the line it reads, but the rest of the code expects the
line to not contain the newline.
Repeat-By:
$ ./bash -c 'enable -f examples/loadables/cut cut ; cut -c4-' <<<
$'abcdef\nghijkl'
def
jkl
$
Fix:
Strip off the newline right after reading the line. Attached patch
fixes the problem.
cut-fix.patch
Description: Text document
- cut loadable outputs extra newlines,
Geir Hauge <=