cut(1) behaviour changed since 5.2.1

From: Dmitry Frolov <frolov_at_riss-telecom.ru>
Date: Thu, 4 Nov 2004 23:58:05 +0600
[ Cc'ing tjr_at_ because he is the comitter of the change in question ]

I'm experiencing a minor problem with cut(1) while trying to run shell
script (installer), written for FreeBSD 5.2.1, on 5.3-RC1 system.

I don't know if it's really a bug, but if it is someone may want look
at it. The problem is that on 5.3 cut returns 'Illegal byte sequence'
(EILSEQ) error while parsing files without trailing newline, while on
5.2.1 it doesn't. It looks like the behaviour was changed with the
revision 1.27 of the cut.c (about handling of multibyte characters).

Here is the demonstration:

frol_at_atlas ttyp0:~$uname -spr
FreeBSD 5.3-RC1 i386
frol_at_atlas ttyp0:~$echo aaa:bbb | cut -d : -f 1
aaa
frol_at_atlas ttyp0:~$echo -n aaa:bbb | cut -d : -f 1
cut: stdin: Illegal byte sequence
frol_at_atlas ttyp0:~$echo $?
1

However on 5.2.1 all goes well:

frol_at_sva ttyp0:~$uname -spr 
FreeBSD 5.2.1-RELEASE-p7 i386
frol_at_sva ttyp0:~$echo aaa:bbb | cut -d : -f 1
aaa
frol_at_sva ttyp0:~$echo -n aaa:bbb | cut -d : -f 1
aaa
frol_at_sva ttyp0:~$echo $?
0

    wbr&w, dmitry.
-- 
Dmitry Frolov <frolov_at_riss-telecom.ru>
RISS-Telecom Network, Novosibirsk, Russia
66415911_at_ICQ, +7 3832 NO WA1T, DVF-RIPE
Received on Thu Nov 04 2004 - 16:58:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:21 UTC