Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!caip!princeton!astrovax!noao!grandi From: grandi@noao.UUCP (Steve Grandi) Newsgroups: net.bugs.4bsd,net.unix-wizards Subject: 4.3BSD sort(1) broken for records with embedded nulls Message-ID: <491@carina.noao.UUCP> Date: Tue, 19-Aug-86 20:11:07 EDT Article-I.D.: carina.491 Posted: Tue Aug 19 20:11:07 1986 Date-Received: Thu, 21-Aug-86 01:05:58 EDT Organization: Natl. Optical Astronomy Observatories, Tucson, AZ USA Lines: 17 Xref: mnetor net.bugs.4bsd:886 net.unix-wizards:7611 Subject: sort will no longer work on records with embedded nulls Index: usr.bin/sort.c 4.3BSD Description: For 4.3BSD, sort(1) was modified (for efficiency) to use fgets/fputs to read and write data records instead of getc/putc. This change breaks sort for data records that have embedded nulls; they will generate spurious error messages "missing newline before EOF" and the data will be totally scrambled. Repeat-By: Read the code. Fix: 1) Reinstall the slow 4.2BSD version. 2) Don't use sort(1) as a quick hack when you really should use qsort(3) -- Steve Grandi, National Optical Astronomy Observatories, Tucson, AZ, 602-325-9228 {arizona,decvax,hao,ihnp4,seismo}!noao!grandi grandi%draco@Hamlet.Caltech.Edu