Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site bu-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!bu-cs!todd From: todd@bu-cs.UUCP (Todd Cooper) Newsgroups: net.unix-wizards,net.bugs.usg Subject: Re: ls(1) on System V Message-ID: <350@bu-cs.UUCP> Date: Sat, 13-Apr-85 14:49:20 EST Article-I.D.: bu-cs.350 Posted: Sat Apr 13 14:49:20 1985 Date-Received: Tue, 16-Apr-85 00:20:28 EST References: <176@mplvax.UUCP> <3411@allegra.UUCP>, <2116@sun.uucp> Organization: Boston Univ Comp. Sci. Lines: 37 Xref: watmath net.unix-wizards:12816 net.bugs.usg:213 > > Well, the problem is that in the readdir() routine, the code is doing > > strlen(dentry.d_name), and d_name isn't null-terminated if it's 14 > > characters long (I think strlen returns 44 or so). > > This is the second S5R2 bug that is fixed "for free" if you convert > to the Berkeley "directory library". The library provides directory > entries with null-terminated names, fixing this bug; the previous bug > was a shell problem caused, if I remember correctly, by testing whether > the result of an "open" of a directory was > 0 rather than whether it > was >= 0. > > I've converted lots of S5R2 programs to use the library; it's very easy. > I'd vote for putting it into 1) the /usr/group standard, 2) the System V > Interface Definition (which currently, bless its soul, does *not* commit > to what directories look like when you open them), and therefore 3) > System V. > > Guy Harris > sun!guy > > The SYSTEM V we are working with on the 3b5 also has the same bug -- yech --- I made the same fix. In fact we are running less than RELEASE 2 --- they have not released release 2 for our system.? en fact, I have taken their ls (release 1.3) and converted it so that if DOES multiple cols. Why didn't they also make it so that the multiple cols come "magically" when you are using a tty as stdout like berkely --- also they do not print a '?' when the a character in a file name is unprintable ala Berkely. -- --------------------------- Todd Cooper (617) 424-9018 UUCP: ...!harvard!bu-cs!todd ARPA: todd%bu-cs.csnet@csnet-relay.arpa USNail: 13 Marlborough St. #1, Boston, MA 02116