ls(1) on System V

Todd Cooper todd at bu-cs.UUCP
Sun Apr 14 05:49:20 AEST 1985


> > 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 at csnet-relay.arpa
USNail:	13 Marlborough St. #1, Boston, MA 02116



More information about the Comp.unix.wizards mailing list